fix: standalone sales invoice return should not fallback to item master for valuation rate

This commit is contained in:
Mihir Kandoi
2026-02-23 14:52:23 +05:30
parent 60e96633c4
commit a85a0aef52
5 changed files with 46 additions and 40 deletions

View File

@@ -237,7 +237,7 @@ def _create_bin(item_code, warehouse):
@frappe.whitelist()
def get_incoming_rate(args, raise_error_if_no_rate=True):
def get_incoming_rate(args, raise_error_if_no_rate=True, fallbacks: bool = True):
"""Get Incoming Rate based on valuation method"""
from erpnext.stock.stock_ledger import get_previous_sle, get_valuation_rate
@@ -325,6 +325,7 @@ def get_incoming_rate(args, raise_error_if_no_rate=True):
args.get("allow_zero_valuation"),
currency=erpnext.get_company_currency(args.get("company")),
company=args.get("company"),
fallbacks=fallbacks,
raise_error_if_no_rate=raise_error_if_no_rate,
)