mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
Merge pull request #47287 from frappe/mergify/bp/version-14-hotfix/pr-47268
fix: allow to change valuation method from FIFO to Moving Average (backport #47268)
This commit is contained in:
@@ -916,6 +916,11 @@ class Item(Document):
|
|||||||
changed_fields = [
|
changed_fields = [
|
||||||
field for field in restricted_fields if cstr(self.get(field)) != cstr(values.get(field))
|
field for field in restricted_fields if cstr(self.get(field)) != cstr(values.get(field))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Allow to change valuation method from FIFO to Moving Average not vice versa
|
||||||
|
if self.valuation_method == "Moving Average" and "valuation_method" in changed_fields:
|
||||||
|
changed_fields.remove("valuation_method")
|
||||||
|
|
||||||
if not changed_fields:
|
if not changed_fields:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user