fix: dont overwrite rate with 0 if not found

This commit is contained in:
Mihir Kandoi
2026-07-17 21:23:49 +05:30
parent 302cbbe5d8
commit 74e9718871

View File

@@ -201,7 +201,9 @@ class MaterialRequest(BuyingController):
), ),
item.item_code, item.item_code,
) )
item.db_set({"rate": flt(rate), "amount": flt(flt(rate) * item.qty, item.precision("amount"))}) if rate is not None:
item.db_set({"rate": flt(rate), "amount": flt(flt(rate) * item.qty, item.precision("amount"))})
frappe.msgprint( frappe.msgprint(
_("Item rates have been updated based on the selected Buying Price List {0}").format( _("Item rates have been updated based on the selected Buying Price List {0}").format(
self.buying_price_list self.buying_price_list