修改计划排程,超过小时产能提示产线的小时产能以及超出的件数

This commit is contained in:
hujiaying
2024-10-10 16:47:25 +08:00
parent d1ff7c196d
commit 50bb50f5ab
3 changed files with 16 additions and 9 deletions

View File

@@ -33,7 +33,9 @@ class Action_Plan_All_Wizard(models.TransientModel):
# 使用传递过来的计划ID
temp_plan_ids = self.plan_ids
# 在这里添加您的逻辑来处理这些ID
count = len(temp_plan_ids) + 1
for plan in temp_plan_ids:
count = count - 1
# 处理每个计划
# 比如更新计划状态、分配资源等
# 示例plan.state = 'scheduled'
@@ -42,7 +44,7 @@ class Action_Plan_All_Wizard(models.TransientModel):
plan_obj = self.env['sf.production.plan'].browse(plan.id)
plan_obj.production_line_id = self.production_line_id.id
plan.date_planned_start = self.date_planned_start
plan_obj.do_production_schedule()
plan_obj.do_production_schedule(count)
# plan_obj.state = 'done'
print('处理计划:', plan.id, '完成')