Merge pull request #7852 from rohitwaghchaure/production_order_issue
[Fix] Production order operations scheduling issue
This commit is contained in:
commit
72c7e73ce0
@ -258,13 +258,11 @@ class ProductionOrder(Document):
|
|||||||
|
|
||||||
timesheet = make_timesheet(self.name)
|
timesheet = make_timesheet(self.name)
|
||||||
workstation_list = []
|
workstation_list = []
|
||||||
last_workstation_idx = {}
|
|
||||||
timesheet.set('time_logs', [])
|
timesheet.set('time_logs', [])
|
||||||
|
|
||||||
for i, d in enumerate(self.operations):
|
for i, d in enumerate(self.operations):
|
||||||
if d.workstation and d.status != 'Completed':
|
if d.workstation and d.status != 'Completed':
|
||||||
last_workstation_idx[d.workstation] = i # set last row index of workstation
|
self.set_start_end_time_for_workstation(d, workstation_list, i)
|
||||||
self.set_start_end_time_for_workstation(d, workstation_list, last_workstation_idx.get(d.workstation))
|
|
||||||
|
|
||||||
args = self.get_operations_data(d)
|
args = self.get_operations_data(d)
|
||||||
add_timesheet_detail(timesheet, args)
|
add_timesheet_detail(timesheet, args)
|
||||||
@ -318,9 +316,8 @@ class ProductionOrder(Document):
|
|||||||
"""Set start and end time for given operation. If first operation, set start as
|
"""Set start and end time for given operation. If first operation, set start as
|
||||||
`planned_start_date`, else add time diff to end time of earlier operation."""
|
`planned_start_date`, else add time diff to end time of earlier operation."""
|
||||||
|
|
||||||
if data.workstation not in workstation_list:
|
if index == 0:
|
||||||
data.planned_start_time = self.planned_start_date
|
data.planned_start_time = self.planned_start_date
|
||||||
workstation_list.append(data.workstation)
|
|
||||||
else:
|
else:
|
||||||
data.planned_start_time = get_datetime(self.operations[index-1].planned_end_time)\
|
data.planned_start_time = get_datetime(self.operations[index-1].planned_end_time)\
|
||||||
+ get_mins_between_operations()
|
+ get_mins_between_operations()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user