解决工单开始结束的问题

This commit is contained in:
胡尧
2024-11-27 09:53:17 +08:00
parent 64fdedf726
commit 12224fc892
2 changed files with 15 additions and 9 deletions

View File

@@ -320,7 +320,11 @@ 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 == '已排':
production.state = 'pending_cam'
if all(
wo_state in ('done', 'cancel') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'done'
else:
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 == '已排':