Merge pull request #48482 from frappe/mergify/bp/version-15-hotfix/pr-48481

fix: stock settings save issue (backport #48481)
This commit is contained in:
rohitwaghchaure
2025-07-09 14:16:18 +05:30
committed by GitHub

View File

@@ -120,7 +120,11 @@ class StockSettings(Document):
)
def cant_change_valuation_method(self):
previous_valuation_method = self.get_doc_before_save().get("valuation_method")
doc_before_save = self.get_doc_before_save()
if not doc_before_save:
return
previous_valuation_method = doc_before_save.get("valuation_method")
if previous_valuation_method and previous_valuation_method != self.valuation_method:
# check if there are any stock ledger entries against items