fix: scrap items order not showing correctly in stock entry (#21346)
This commit is contained in:
parent
3d2ced7926
commit
a92eaff83b
@ -865,14 +865,6 @@ class StockEntry(StockController):
|
||||
|
||||
self.add_to_stock_entry_detail(item_dict)
|
||||
|
||||
if self.purpose != "Send to Subcontractor" and self.purpose in ["Manufacture", "Repack"]:
|
||||
scrap_item_dict = self.get_bom_scrap_material(self.fg_completed_qty)
|
||||
for item in itervalues(scrap_item_dict):
|
||||
if self.pro_doc and self.pro_doc.scrap_warehouse:
|
||||
item["to_warehouse"] = self.pro_doc.scrap_warehouse
|
||||
|
||||
self.add_to_stock_entry_detail(scrap_item_dict, bom_no=self.bom_no)
|
||||
|
||||
# fetch the serial_no of the first stock entry for the second stock entry
|
||||
if self.work_order and self.purpose == "Manufacture":
|
||||
self.set_serial_nos(self.work_order)
|
||||
@ -883,9 +875,20 @@ class StockEntry(StockController):
|
||||
if self.purpose in ("Manufacture", "Repack"):
|
||||
self.load_items_from_bom()
|
||||
|
||||
self.set_scrap_items()
|
||||
self.set_actual_qty()
|
||||
self.calculate_rate_and_amount(raise_error_if_no_rate=False)
|
||||
|
||||
def set_scrap_items(self):
|
||||
if self.purpose != "Send to Subcontractor" and self.purpose in ["Manufacture", "Repack"]:
|
||||
scrap_item_dict = self.get_bom_scrap_material(self.fg_completed_qty)
|
||||
for item in itervalues(scrap_item_dict):
|
||||
item.idx = ''
|
||||
if self.pro_doc and self.pro_doc.scrap_warehouse:
|
||||
item["to_warehouse"] = self.pro_doc.scrap_warehouse
|
||||
|
||||
self.add_to_stock_entry_detail(scrap_item_dict, bom_no=self.bom_no)
|
||||
|
||||
def set_work_order_details(self):
|
||||
if not getattr(self, "pro_doc", None):
|
||||
self.pro_doc = frappe._dict()
|
||||
|
Loading…
x
Reference in New Issue
Block a user