fix: routing operations not added sequentially in the BOM

This commit is contained in:
Rohit Waghchaure 2020-06-04 14:46:50 +05:30
parent 7a05662e9f
commit 404ed88c0c

View File

@ -112,13 +112,14 @@ class BOM(WebsiteGenerator):
if self.routing:
self.set("operations", [])
for d in frappe.get_all("BOM Operation", fields = ["*"],
filters = {'parenttype': 'Routing', 'parent': self.routing}):
filters = {'parenttype': 'Routing', 'parent': self.routing}, order_by="idx"):
child = self.append('operations', {
"operation": d.operation,
"workstation": d.workstation,
"description": d.description,
"time_in_mins": d.time_in_mins,
"batch_size": d.batch_size
"batch_size": d.batch_size,
"idx": d.idx
})
child.hour_rate = flt(d.hour_rate / self.conversion_rate, 2)