解决工单完成的问题

This commit is contained in:
胡尧
2024-11-27 17:40:35 +08:00
parent df146a4b58
commit c169c0a80b
2 changed files with 3 additions and 7 deletions

View File

@@ -320,11 +320,7 @@ class MrpProduction(models.Model):
elif production.state == 'pending_cam' and production.schedule_state == '未排':
production.state = 'confirmed'
elif production.state == 'to_close' and production.schedule_state == '已排':
if all(
wo_state in ('done', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'done'
else:
production.state = 'pending_cam'
production.state = 'pending_cam'
elif production.state == 'confirmed' and production.is_adjust is True:
production.state = 'technology_to_confirmed'
if production.state == 'confirmed' and production.schedule_state == '已排':