解决精坯料计算精度问题,排程加上预留时间
This commit is contained in:
@@ -242,10 +242,10 @@ class sf_production_plan(models.Model):
|
||||
# 设置一个小的开始时间
|
||||
first_cnc_workorder.date_planned_start = datetime.now() - timedelta(days=100)
|
||||
first_cnc_workorder.date_planned_finished = date_start + timedelta(
|
||||
minutes=routing_workcenter.time_cycle)
|
||||
minutes=routing_workcenter.time_cycle + routing_workcenter.reserved_duration)
|
||||
first_cnc_workorder.date_planned_start = date_start
|
||||
record.sudo().production_id.plan_start_processing_time = first_cnc_workorder.date_planned_start
|
||||
first_cnc_workorder.duration_expected = routing_workcenter.time_cycle
|
||||
first_cnc_workorder.duration_expected = routing_workcenter.time_cycle + routing_workcenter.reserved_duration
|
||||
record.calculate_plan_time(first_cnc_workorder, record.production_id.workorder_ids)
|
||||
# 找到最后一张CNC加工工单
|
||||
last_cnc_workorder = record.production_id.workorder_ids.filtered(lambda x: x.name == 'CNC加工')[-1]
|
||||
@@ -257,10 +257,10 @@ class sf_production_plan(models.Model):
|
||||
routing_workcenter = item.technology_design_id.route_id
|
||||
item.date_planned_start = datetime.now() - timedelta(days=100)
|
||||
item.date_planned_finished = wo_start + timedelta(
|
||||
minutes=routing_workcenter.time_cycle)
|
||||
minutes=routing_workcenter.time_cycle + routing_workcenter.reserved_duration)
|
||||
item.date_planned_start = wo_start
|
||||
record.sudo().production_id.plan_start_processing_time = item.date_planned_start
|
||||
item.duration_expected = routing_workcenter.time_cycle
|
||||
item.duration_expected = routing_workcenter.time_cycle + routing_workcenter.reserved_duration
|
||||
record.calculate_plan_time(item, record.production_id.workorder_ids)
|
||||
last_cnc_workorder = record.production_id.workorder_ids[-1]
|
||||
record.date_planned_finished = last_cnc_workorder.date_planned_finished
|
||||
@@ -338,8 +338,8 @@ class sf_production_plan(models.Model):
|
||||
next_workorder.date_planned_start = datetime.now() - timedelta(days=100)
|
||||
next_workorder.date_planned_finished = current_workorder.date_planned_start
|
||||
next_workorder.date_planned_start = next_workorder.date_planned_finished - timedelta(
|
||||
minutes=routing_workcenter.time_cycle)
|
||||
next_workorder.duration_expected = routing_workcenter.time_cycle
|
||||
minutes=routing_workcenter.time_cycle + routing_workcenter.reserved_duration)
|
||||
next_workorder.duration_expected = routing_workcenter.time_cycle + routing_workcenter.reserved_duration
|
||||
|
||||
for i in range(item_position, len(workorder_list) - 1):
|
||||
if i > len(workorder_list) - 1:
|
||||
@@ -350,9 +350,9 @@ class sf_production_plan(models.Model):
|
||||
# 设置一个小的开始时间
|
||||
next_workorder.date_planned_start = datetime.now() - timedelta(days=100)
|
||||
next_workorder.date_planned_finished = current_workorder.date_planned_finished + timedelta(
|
||||
minutes=routing_workcenter.time_cycle)
|
||||
minutes=routing_workcenter.time_cycle + routing_workcenter.reserved_duration)
|
||||
next_workorder.date_planned_start = current_workorder.date_planned_finished
|
||||
next_workorder.duration_expected = routing_workcenter.time_cycle
|
||||
next_workorder.duration_expected = routing_workcenter.time_cycle + routing_workcenter.reserved_duration
|
||||
|
||||
def calculate_plan_time_after(self, item, workorder_id_list):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user