处理CNC加工工单通过接口上产线下产线变更为待检测时,对应质检单还是等待状态问题
This commit is contained in:
@@ -1543,7 +1543,15 @@ class ResMrpWorkOrder(models.Model):
|
||||
# 修改工单状态
|
||||
self.write({'state': 'to be detected'})
|
||||
# 若关联的【质量检查_需送检】=true,则质量检查单的状态从“等待”更新为“待处理”
|
||||
self.check_ids.filtered(lambda ch: ch.is_inspect is True).write({'quality_state': 'none'})
|
||||
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' and wm.check_ids:
|
||||
wm.check_ids.filtered(lambda ch: ch.is_inspect is True and ch.quality_state == 'waiting').write(
|
||||
{'quality_state': 'none'})
|
||||
|
||||
|
||||
class CNCprocessing(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user