fix: Add item to packing list

(cherry picked from commit a473e1dbe9)
This commit is contained in:
GangaManoj
2021-12-01 01:27:34 +05:30
committed by mergify-bot
parent 1b8a947a18
commit 1ec0cd4e5b

View File

@@ -106,15 +106,34 @@ def cleanup_packing_list(doc, parent_items):
if not delete_list: if not delete_list:
return doc return doc
index = 1
packed_items = doc.get("packed_items") packed_items = doc.get("packed_items")
doc.set("packed_items", []) doc.set("packed_items", [])
for d in packed_items: for d in packed_items:
if d not in delete_list: if d not in delete_list:
d.idx = index add_item_to_packing_list(doc, d)
doc.append("packed_items", d)
index += 1 def add_item_to_packing_list(doc, packed_item):
doc.append("packed_items", {
'parent_item': packed_item.parent_item,
'item_code': packed_item.item_code,
'item_name': packed_item.item_name,
'uom': packed_item.uom,
'qty': packed_item.qty,
'rate': packed_item.rate,
'conversion_factor': packed_item.conversion_factor,
'description': packed_item.description,
'warehouse': packed_item.warehouse,
'batch_no': packed_item.batch_no,
'actual_batch_qty': packed_item.actual_batch_qty,
'serial_no': packed_item.serial_no,
'target_warehouse': packed_item.target_warehouse,
'actual_qty': packed_item.actual_qty,
'projected_qty': packed_item.projected_qty,
'incoming_rate': packed_item.incoming_rate,
'prevdoc_doctype': packed_item.prevdoc_doctype,
'parent_detail_docname': packed_item.parent_detail_docname
})
def update_product_bundle_price(doc, parent_items): def update_product_bundle_price(doc, parent_items):
"""Updates the prices of Product Bundles based on the rates of the Items in the bundle.""" """Updates the prices of Product Bundles based on the rates of the Items in the bundle."""