1、当检测到缺刀工单需要的功能刀具从刀具房出库到线边刀架时,更改cnc编程单的功能刀具状态为正常;

This commit is contained in:
yuxianghui
2024-07-11 16:37:20 +08:00
parent 134e23ea2f
commit 77815c45a0
4 changed files with 19 additions and 4 deletions

View File

@@ -32,9 +32,9 @@ class MrpProduction(models.Model):
def _compute_tool_state(self):
for item in self:
if item:
if item.workorder_ids.filtered(lambda a: a.tool_state == '2'):
if item.workorder_ids.filtered(lambda a: a.tool_state == '2' and a.state not in ('rework', '返工')):
item.tool_state = '2'
elif item.workorder_ids.filtered(lambda a: a.tool_state == '1'):
elif item.workorder_ids.filtered(lambda a: a.tool_state == '1' and a.state not in ('rework', '返工')):
item.tool_state = '1'
else:
item.tool_state = '0'