Merge pull request #7712 from rohitwaghchaure/minor_fix_item_valuation_method
[Fix] Valuation method changing issue in the item
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 53faa43..4d5265f 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -451,6 +451,8 @@
"valuation_method", "has_batch_no", "is_fixed_asset")
vals = frappe.db.get_value("Item", self.name, to_check, as_dict=True)
+ if not vals.get('valuation_method') and self.get('valuation_method'):
+ vals['valuation_method'] = frappe.db.get_single_value("Stock Settings", "valuation_method") or "FIFO"
if vals:
for key in to_check: