Merge pull request #47024 from frappe/mergify/bp/version-15/pr-47023

fix: condition for use_batchwise_valuation (backport #47022) (backport #47023)
This commit is contained in:
rohitwaghchaure
2025-04-11 20:44:54 +05:30
committed by GitHub

View File

@@ -160,7 +160,9 @@ class Batch(Document):
from erpnext.stock.utils import get_valuation_method
if self.is_new():
if frappe.db.get_single_value("Stock Settings", "do_not_use_batchwise_valuation"):
if get_valuation_method(self.item) == "Moving Average" and frappe.db.get_single_value(
"Stock Settings", "do_not_use_batchwise_valuation"
):
self.use_batchwise_valuation = 0
return