fix: use correct variable to fetch valuation method

(cherry picked from commit 1492c9fbc3)

# Conflicts:
#	erpnext/controllers/sales_and_purchase_return.py
This commit is contained in:
Mihir Kandoi
2026-06-30 20:23:14 +05:30
committed by Mergify
parent 1d24e1ef62
commit c2b7718455

View File

@@ -143,7 +143,11 @@ def validate_returned_items(doc):
ref.rate
and flt(d.rate) > ref.rate
and doc.doctype in ("Delivery Note", "Sales Invoice")
<<<<<<< HEAD
and get_valuation_method(ref.item_code) != "Moving Average"
=======
and get_valuation_method(d.item_code, doc.company) != "Moving Average"
>>>>>>> 1492c9fbc3 (fix: use correct variable to fetch valuation method)
):
frappe.throw(
_("Row # {0}: Rate cannot be greater than the rate used in {1} {2}").format(