diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 1568729344..518fe74889 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -124,6 +124,7 @@ class Item(WebsiteGenerator): self.update_defaults_from_item_group() self.validate_auto_reorder_enabled_in_stock_settings() self.cant_change() + self.update_show_in_website() if not self.get("__islocal"): self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group") @@ -476,6 +477,10 @@ class Item(WebsiteGenerator): [self.remove(d) for d in to_remove] + def update_show_in_website(self): + if self.disabled: + self.show_in_website = False + def update_template_tables(self): template = frappe.get_doc("Item", self.variant_of)