def on_update(self): super(DocType, self).on_update() self.validate_name_with_item() from website.helpers.product import invalidate_cache_for if self.doc.show_in_website: from webnotes.webutils import update_page_name # webpage updates page_name = self.doc.name update_page_name(self.doc, page_name) invalidate_cache_for(self.doc.name) elif self.doc.page_name: # if unchecked show in website from webnotes.webutils import delete_page_cache delete_page_cache(self.doc.page_name) invalidate_cache_for(self.doc.name) webnotes.conn.set(self.doc, "page_name", None) self.validate_one_root()
def _invalidate_cache(): from website.helpers.product import invalidate_cache_for invalidate_cache_for(self.doc.item_group) [invalidate_cache_for(d.item_group) for d in \ self.doclist.get({"doctype":"Website Item Group"})]
def on_update(self): super(DocType, self).on_update() self.validate_name_with_item() from website.helpers.product import invalidate_cache_for if self.doc.show_in_website: from webnotes.webutils import update_page_name # webpage updates page_name = self.doc.name if webnotes.conn.get_value( "Product Settings", None, "default_product_category") == self.doc.name: page_name = "products" from webnotes.webutils import clear_cache clear_cache() update_page_name(self.doc, page_name) invalidate_cache_for(self.doc.name) elif self.doc.page_name: # if unchecked show in website from webnotes.webutils import delete_page_cache delete_page_cache(self.doc.page_name) invalidate_cache_for(self.doc.name) webnotes.conn.set(self.doc, "page_name", None)
def on_update(self): super(DocType, self).on_update() self.validate_name_with_item() from website.helpers.product import invalidate_cache_for if self.doc.show_in_website: from webnotes.webutils import update_page_name # webpage updates page_name = self.doc.name if webnotes.conn.get_value("Product Settings", None, "default_product_category")==self.doc.name: page_name = "products" from webnotes.webutils import clear_cache clear_cache() update_page_name(self.doc, page_name) invalidate_cache_for(self.doc.name) elif self.doc.page_name: # if unchecked show in website from webnotes.webutils import delete_page_cache delete_page_cache(self.doc.page_name) invalidate_cache_for(self.doc.name) webnotes.conn.set(self.doc, "page_name", None)
def update_website(self): from website.utils import update_page_name update_page_name(self.doc, self.doc.item_name) from website.helpers.product import invalidate_cache_for invalidate_cache_for(self.doc.item_group) [invalidate_cache_for(d.item_group) for d in \ self.doclist.get({"doctype":"Website Item Group"})]
def update_website(self): from website.utils import update_page_name if self.doc.name == self.doc.item_name: page_name_from = self.doc.name else: page_name_from = self.doc.name + " " + self.doc.item_name update_page_name(self.doc, page_name_from) from website.helpers.product import invalidate_cache_for invalidate_cache_for(self.doc.item_group) [invalidate_cache_for(d.item_group) for d in \ self.doclist.get({"doctype":"Website Item Group"})]
def update_website(self): from website.utils import update_page_name if self.doc.name == self.doc.item_name: page_name_from = self.doc.name else: page_name_from = self.doc.name + " " + self.doc.item_name update_page_name(self.doc, page_name_from) from website.helpers.product import invalidate_cache_for invalidate_cache_for(self.doc.item_group) [invalidate_cache_for(d.item_group) for d in self.doclist.get({"doctype": "Website Item Group"})]
def on_update(self): super(DocType, self).on_update() if self.doc.show_in_website: # webpage updates from website.utils import update_page_name page_name = self.doc.name if webnotes.conn.get_value("Product Settings", None, "default_product_category")==self.doc.name: page_name = "products" from website.utils import clear_cache clear_cache() update_page_name(self.doc, page_name) from website.helpers.product import invalidate_cache_for invalidate_cache_for(self.doc.name)
def on_update(self): super(DocType, self).on_update() self.validate_name_with_item() if self.doc.show_in_website: # webpage updates from website.utils import update_page_name page_name = self.doc.name if webnotes.conn.get_value("Product Settings", None, "default_product_category")==self.doc.name: page_name = "products" from website.utils import clear_cache clear_cache() update_page_name(self.doc, page_name) from website.helpers.product import invalidate_cache_for invalidate_cache_for(self.doc.name)