mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
function moved to validate
This commit is contained in:
@@ -57,6 +57,7 @@ class Item(WebsiteGenerator):
|
|||||||
self.validate_reorder_level()
|
self.validate_reorder_level()
|
||||||
self.validate_warehouse_for_reorder()
|
self.validate_warehouse_for_reorder()
|
||||||
self.validate_variants()
|
self.validate_variants()
|
||||||
|
self.update_item_desc()
|
||||||
|
|
||||||
if not self.get("__islocal"):
|
if not self.get("__islocal"):
|
||||||
self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group")
|
self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group")
|
||||||
@@ -69,7 +70,6 @@ class Item(WebsiteGenerator):
|
|||||||
self.validate_name_with_item_group()
|
self.validate_name_with_item_group()
|
||||||
self.update_item_price()
|
self.update_item_price()
|
||||||
self.sync_variants()
|
self.sync_variants()
|
||||||
self.update_item_desc()
|
|
||||||
|
|
||||||
def get_context(self, context):
|
def get_context(self, context):
|
||||||
context["parent_groups"] = get_parent_item_groups(self.item_group) + \
|
context["parent_groups"] = get_parent_item_groups(self.item_group) + \
|
||||||
@@ -436,6 +436,7 @@ class Item(WebsiteGenerator):
|
|||||||
row.description = desc
|
row.description = desc
|
||||||
|
|
||||||
def update_item_desc(self):
|
def update_item_desc(self):
|
||||||
|
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` 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 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))
|
frappe.db.sql("""update `tabBOM Explosion Item` set description = %s where item_code = %s and docstatus < 2""",(self.description, self.name))
|
||||||
|
|||||||
Reference in New Issue
Block a user