修改业务逻辑:当主制造订单排程后,子bom自动改状态为已排

This commit is contained in:
mgw
2024-01-02 11:47:40 +08:00
parent 2339f75517
commit 56d8190fc6

View File

@@ -173,6 +173,10 @@ class sf_production_plan(models.Model):
item.date_planned_start, item.date_planned_finished
self.state = 'done'
self.production_id.schedule_state = '已排'
mrp_production_ids = self.production_id._get_children().ids
print('mrp_production_ids', mrp_production_ids)
for i in mrp_production_ids:
self.env['mrp.production'].browse(i).schedule_state = '已排'
# self.production_id.date_planned_start = self.date_planned_start
# self.production_id.date_planned_finished = self.date_planned_finished
else: