From e108e2d5d62e798c68597e5e88b59133ec4ca4d6 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 22 Apr 2024 10:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=A5=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=B1=95=E7=A4=BA=EF=BC=8C=E5=B7=A5=E5=8D=95=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=A2=9E=E5=8A=A0=E9=95=BF=E5=AE=BD=E9=AB=98=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 134922d1..3ccef829 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -104,7 +104,7 @@ class ResMrpWorkOrder(models.Model): cnc_ids = fields.One2many("sf.cnc.processing", 'workorder_id', string="CNC加工程序") cmm_ids = fields.One2many("sf.cmm.program", 'workorder_id', string="CMM程序") tray_code = fields.Char(string="托盘编码") - glb_file = fields.Binary("glb模型文件") + glb_file = fields.Binary("glb模型文件", related='production_id.model_file') is_subcontract = fields.Boolean(string='是否外协') surface_technics_parameters_id = fields.Many2one('sf.production.process.parameter', string="表面工艺可选参数") picking_in_id = fields.Many2one('stock.picking', string='外协入库单') @@ -719,6 +719,12 @@ class ResMrpWorkOrder(models.Model): picking_out.write({'state': 'assigned'}) if self.state == 'waiting' or self.state == 'ready' or self.state == 'progress': self.move_raw_ids = self.production_id.move_raw_ids + self.move_raw_ids[0].write({ + 'materiel_length': self.move_raw_ids[0].product_id.length, + 'materiel_width': self.move_raw_ids[0].product_id.width, + 'materiel_height': self.move_raw_ids[0].product_id.height + }) + self.ensure_one() if any(not time.date_end for time in self.time_ids.filtered(lambda t: t.user_id.id == self.env.user.id)): return True