def after_rename(self, olddn, newdn, merge): self.setup_generator() if not self.website_template: return frappe.db.sql("""update `tabWebsite Route` set docname=%s where ref_doctype=%s and docname=%s""", (newdn, self.doctype, olddn)) if merge: remove_sitemap(ref_doctype=self.doctype, docname=olddn)
def after_rename(self, olddn, newdn, merge): frappe.db.sql( """update `tabWebsite Route` set docname=%s where ref_doctype=%s and docname=%s""", (newdn, self.doc.doctype, olddn)) if merge: self.setup_generator() remove_sitemap(ref_doctype=self.doc.doctype, docname=olddn)
def update_sitemap(self): self.setup_generator() if self.website_template.condition_field and \ not self.doc.fields.get(self.website_template.condition_field): # condition field failed, remove and return! remove_sitemap(ref_doctype=self.doc.doctype, docname=self.doc.name) return self.add_or_update_sitemap()
def update_sitemap(self): self.setup_generator() if not self.website_template: return if self.website_template.condition_field and \ not self.get(self.website_template.condition_field): # condition field failed, remove and return! remove_sitemap(ref_doctype=self.doctype, docname=self.name) return self.add_or_update_sitemap()
def on_trash(self): remove_sitemap(ref_doctype=self.doctype, docname=self.name)
def on_trash(self): self.setup_generator() if not self.website_template: return remove_sitemap(ref_doctype=self.doctype, docname=self.name)
def on_trash(self): self.setup_generator() remove_sitemap(ref_doctype=self.doc.doctype, docname=self.doc.name)
def on_trash(self): self.setup_generator() if not self.website_template: return remove_sitemap(ref_doctype=self.doctype, docname=self.name)