fix: Reset indices in the Packed/Bundle Items table on deleting Product Bundles

This commit is contained in:
GangaManoj 2021-11-24 21:05:54 +05:30
parent 136dd4f801
commit 8370042f82

View File

@ -106,11 +106,15 @@ def cleanup_packing_list(doc, parent_items):
if not delete_list:
return doc
index = 1
packed_items = doc.get("packed_items")
doc.set("packed_items", [])
for d in packed_items:
if d not in delete_list:
d.idx = index
doc.append("packed_items", d)
index += 1
def update_product_bundle_price(doc, parent_items):
"""Updates the prices of Product Bundles based on the rates of the Items in the bundle."""