diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 352da1846b9..db6201874a6 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -951,11 +951,8 @@ def get_valuation_rate(args): valuation_rate = item_valuation.get("valuation_rate") - if valuation_rate is None: - # Explicit null value check. If null, Bins don't exist, neither does SLE - return valuation_rate - - if valuation_rate <= 0: + if (valuation_rate is not None) and valuation_rate <= 0: + # Explicit null value check. If None, Bins don't exist, neither does SLE last_valuation_rate = frappe.db.sql( """select valuation_rate from `tabStock Ledger Entry`