添加工单开始校验

This commit is contained in:
yuxianghui
2024-07-24 12:32:33 +08:00
parent 1d271d9167
commit 4297d41dda
3 changed files with 22 additions and 34 deletions

View File

@@ -35,7 +35,7 @@ class MrpProduction(models.Model):
@api.depends('workorder_ids.tool_state')
def _compute_tool_state(self):
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'