mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-21 18:36:30 +00:00
fix: allow to change valuation method from FIFO to Moving Average
(cherry picked from commit b454ed4b8f)
This commit is contained in:
committed by
Mergify
parent
f8da1599bb
commit
b2294ed6e3
@@ -970,6 +970,11 @@ class Item(Document):
|
||||
changed_fields = [
|
||||
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:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user