修复工单预计结束时间会取实际结束时间的问题
This commit is contained in:
@@ -827,8 +827,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
else:
|
||||
if self.date_planned_start > start_date:
|
||||
vals['date_planned_start'] = start_date
|
||||
if self.date_planned_finished and self.date_planned_finished < start_date:
|
||||
vals['date_planned_finished'] = start_date
|
||||
# if self.date_planned_finished and self.date_planned_finished < start_date:
|
||||
# vals['date_planned_finished'] = start_date
|
||||
return self.write(vals)
|
||||
else:
|
||||
raise UserError(_('请先完成上一步工单'))
|
||||
@@ -875,7 +875,11 @@ class ResMrpWorkOrder(models.Model):
|
||||
'state': 'draft',
|
||||
'order_line': order_line_ids,
|
||||
})
|
||||
tem_date_planned_finished = record.date_planned_finished
|
||||
super().button_finish()
|
||||
record.write({
|
||||
'date_planned_finished': tem_date_planned_finished # 保持原值
|
||||
})
|
||||
is_production_id = True
|
||||
for workorder in record.production_id.workorder_ids:
|
||||
if workorder.state != 'done':
|
||||
|
||||
Reference in New Issue
Block a user