修复“同一个产品多个制造订单时-只有一张制造订单有组件”

This commit is contained in:
mgw
2024-07-24 12:17:32 +08:00
parent dec85dc92f
commit d3e307d195
2 changed files with 2 additions and 2 deletions

View File

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