Merge pull request #48481 from rohitwaghchaure/fixed-support-43199

fix: stock settings save issue
This commit is contained in:
rohitwaghchaure
2025-07-09 12:02:46 +05:30
committed by GitHub

View File

@@ -121,7 +121,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