fix: use item valuation rate if no bin

(cherry picked from commit 23b1b7ee04)
This commit is contained in:
ravibharathi656
2025-09-26 13:19:31 +05:30
committed by Mergify
parent 56d04761f8
commit a4b5a74644

View File

@@ -1516,7 +1516,7 @@ def get_valuation_rate(item_code, company, warehouse=None):
return frappe.db.get_value(
"Bin", {"item_code": item_code, "warehouse": warehouse}, ["valuation_rate"], as_dict=True
) or {"valuation_rate": 0}
) or {"valuation_rate": item.get("valuation_rate") or 0}
elif not item.get("is_stock_item"):
pi_item = frappe.qb.DocType("Purchase Invoice Item")