From e107d3ca84b824536381fae5fb089c68215d7e0e Mon Sep 17 00:00:00 2001 From: V Shankar Date: Thu, 12 Mar 2026 10:29:59 +0530 Subject: [PATCH] fix: re-calculate taxes and totals after resetting bundle item rate (#53342) --- erpnext/stock/doctype/packed_item/packed_item.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 455ea9e96bf..5548b2485d8 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -354,11 +354,19 @@ def update_product_bundle_rate(parent_items_price, pi_row, item_row): def set_product_bundle_rate_amount(doc, parent_items_price): "Set cumulative rate and amount in bundle item." + rate_updated = False for item in doc.get("items"): bundle_rate = parent_items_price.get((item.item_code, item.name)) if bundle_rate and bundle_rate != item.rate: item.rate = bundle_rate item.amount = flt(bundle_rate * item.qty) + item.margin_rate_or_amount = 0 + item.discount_percentage = 0 + item.discount_amount = 0 + rate_updated = True + if rate_updated: + doc.calculate_taxes_and_totals() + doc.set_total_in_words() def on_doctype_update():