function moved to validate
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 633ead1..351f717 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -57,6 +57,7 @@
self.validate_reorder_level()
self.validate_warehouse_for_reorder()
self.validate_variants()
+ self.update_item_desc()
if not self.get("__islocal"):
self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group")
@@ -69,7 +70,6 @@
self.validate_name_with_item_group()
self.update_item_price()
self.sync_variants()
- self.update_item_desc()
def get_context(self, context):
context["parent_groups"] = get_parent_item_groups(self.item_group) + \
@@ -436,9 +436,10 @@
row.description = desc
def update_item_desc(self):
- frappe.db.sql("""update `tabBOM` set description = %s where item = %s and docstatus < 2""",(self.description, self.name))
- frappe.db.sql("""update `tabBOM Item` set description = %s where item_code = %s and docstatus < 2""",(self.description, self.name))
- frappe.db.sql("""update `tabBOM Explosion Item` set description = %s where item_code = %s and docstatus < 2""",(self.description, self.name))
+ if frappe.db.get_value('BOM',self.name, 'description') != self.description:
+ frappe.db.sql("""update `tabBOM` set description = %s where item = %s and docstatus < 2""",(self.description, self.name))
+ frappe.db.sql("""update `tabBOM Item` set description = %s where item_code = %s and docstatus < 2""",(self.description, self.name))
+ frappe.db.sql("""update `tabBOM Explosion Item` set description = %s where item_code = %s and docstatus < 2""",(self.description, self.name))
def validate_end_of_life(item_code, end_of_life=None, verbose=1):
if not end_of_life: