mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 21:49:18 +00:00
[fix] Update show_in_website in template
This commit is contained in:
@@ -604,19 +604,20 @@ class Item(WebsiteGenerator):
|
|||||||
|
|
||||||
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"""
|
||||||
if self.variant_of and self.show_in_website:
|
if self.variant_of:
|
||||||
self.show_variant_in_website = 1
|
if self.show_in_website:
|
||||||
self.show_in_website = 0
|
self.show_variant_in_website = 1
|
||||||
|
self.show_in_website = 0
|
||||||
|
|
||||||
if self.show_variant_in_website:
|
if self.show_variant_in_website:
|
||||||
# show template
|
# show template
|
||||||
template_item = frappe.get_doc("Item", self.variant_of)
|
template_item = frappe.get_doc("Item", self.variant_of)
|
||||||
|
|
||||||
if not template_item.show_in_website:
|
if not template_item.show_in_website:
|
||||||
template_item.show_in_website = 1
|
template_item.show_in_website = 1
|
||||||
template_item.flags.dont_update_variants = True
|
template_item.flags.dont_update_variants = True
|
||||||
template_item.flags.ignore_permissions = True
|
template_item.flags.ignore_permissions = True
|
||||||
template_item.save()
|
template_item.save()
|
||||||
|
|
||||||
def update_variants(self):
|
def update_variants(self):
|
||||||
if self.flags.dont_update_variants or \
|
if self.flags.dont_update_variants or \
|
||||||
|
|||||||
Reference in New Issue
Block a user