修复“同一个产品多个制造订单时-只有一张制造订单有组件”
This commit is contained in:
@@ -324,7 +324,6 @@ class WorkCenterBarcode(models.Model):
|
||||
machine_tool_compensation_value_x = fields.Char('x补偿值', readonly=True)
|
||||
machine_tool_compensation_value_y = fields.Char('y补偿值', readonly=True)
|
||||
|
||||
|
||||
# 工单状态
|
||||
|
||||
delivery_records = fields.One2many('delivery.record', 'workorder_id', string="下发记录")
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user