fix: update show in website on disabling item (#18831)

This commit is contained in:
Mangesh-Khairnar 2019-08-26 10:27:25 +05:30 committed by Nabin Hait
parent d8c262fd5c
commit 5dd1b50802

View File

@ -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)