diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py index 2a5e4d3e..64a981ad 100644 --- a/sf_manufacturing/controllers/controllers.py +++ b/sf_manufacturing/controllers/controllers.py @@ -596,6 +596,9 @@ class Manufacturing_Connect(http.Controller): if panel_workorder: panel_workorder.write({'production_line_state': '已下产线'}) workorder.write({'state': 'to be detected'}) + workorder.check_ids.filtered( + lambda ch: ch.quality_state == 'waiting').write( + {'quality_state': 'none'}) else: res = {'Succeed': False, 'ErrorCode': 204, 'Error': 'DeviceId为%s没有对应的已配送工件数据' % ret['DeviceId']} diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index f9648d43..f8197783 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1546,13 +1546,6 @@ class ResMrpWorkOrder(models.Model): self.check_ids.filtered(lambda ch: ch.is_inspect is True and ch.quality_state == 'waiting').write( {'quality_state': 'none'}) - @api.onchange('state') - def _onchange_state_quality(self): - for wm in self: - if wm.routing_type == 'CNC加工' and wm.state == 'to be detected': - wm.check_ids.filtered(lambda ch: ch.quality_state == 'waiting').write( - {'quality_state': 'none'}) - class CNCprocessing(models.Model): _name = 'sf.cnc.processing'