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'