fix: Reset indices in the Packed/Bundle Items table on deleting Product Bundles
(cherry picked from commit 8370042f82)
This commit is contained in:
@@ -106,11 +106,15 @@ 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
|
||||||
doc.append("packed_items", d)
|
doc.append("packed_items", d)
|
||||||
|
index += 1
|
||||||
|
|
||||||
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."""
|
||||||
|
|||||||
Reference in New Issue
Block a user