From d3e307d195a9d531a588e5a37ec85e74a7696ae9 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 24 Jul 2024 12:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E2=80=9C=E5=90=8C=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E4=BA=A7=E5=93=81=E5=A4=9A=E4=B8=AA=E5=88=B6=E9=80=A0?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=B6-=E5=8F=AA=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E5=BC=A0=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E6=9C=89=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_machine_connect/models/ftp_client.py | 1 - sf_manufacturing/models/mrp_production.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sf_machine_connect/models/ftp_client.py b/sf_machine_connect/models/ftp_client.py index ebccb516..ec46d620 100644 --- a/sf_machine_connect/models/ftp_client.py +++ b/sf_machine_connect/models/ftp_client.py @@ -324,7 +324,6 @@ class WorkCenterBarcode(models.Model): machine_tool_compensation_value_x = fields.Char('x补偿值', readonly=True) machine_tool_compensation_value_y = fields.Char('y补偿值', readonly=True) - # 工单状态 delivery_records = fields.One2many('delivery.record', 'workorder_id', string="下发记录") diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 9ccbaea6..960d4b14 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -34,8 +34,9 @@ class MrpProduction(models.Model): @api.depends('workorder_ids.tool_state') def _compute_tool_state(self): + # if self.workorder_ids: for item in self: - if item: + if item.workorder_ids: workorder_ids = item.workorder_ids.filtered(lambda a: a.state not in ('rework', '返工')) if workorder_ids.filtered(lambda a: a.tool_state == '2'): item.tool_state = '2'