mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
[fix] Update bom item description (#11498)
* [fix] Update bom item description * Update item.py
This commit is contained in:
@@ -91,7 +91,7 @@ class Item(WebsiteGenerator):
|
|||||||
self.validate_barcode()
|
self.validate_barcode()
|
||||||
self.cant_change()
|
self.cant_change()
|
||||||
self.validate_warehouse_for_reorder()
|
self.validate_warehouse_for_reorder()
|
||||||
self.update_item_desc()
|
self.update_bom_item_desc()
|
||||||
self.synced_with_hub = 0
|
self.synced_with_hub = 0
|
||||||
|
|
||||||
self.validate_has_variants()
|
self.validate_has_variants()
|
||||||
@@ -599,13 +599,27 @@ class Item(WebsiteGenerator):
|
|||||||
row.label = label
|
row.label = label
|
||||||
row.description = desc
|
row.description = desc
|
||||||
|
|
||||||
def update_item_desc(self):
|
def update_bom_item_desc(self):
|
||||||
if frappe.db.get_value('BOM',self.name, 'description') != self.description:
|
if self.is_new(): return
|
||||||
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
|
if self.db_get('description') != self.description:
|
||||||
item_code = %s and docstatus < 2""",(self.description, self.name))
|
frappe.db.sql("""
|
||||||
frappe.db.sql("""update `tabBOM Explosion Item` set description = %s where
|
update `tabBOM`
|
||||||
item_code = %s and docstatus < 2""",(self.description, self.name))
|
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 update_template_item(self):
|
def update_template_item(self):
|
||||||
"""Set Show in Website for Template Item if True for its Variant"""
|
"""Set Show in Website for Template Item if True for its Variant"""
|
||||||
|
|||||||
Reference in New Issue
Block a user