Ejemplo n.º 1
0
	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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
	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()
Ejemplo n.º 5
0
 def on_trash(self):
     remove_sitemap(ref_doctype=self.doctype, docname=self.name)
Ejemplo n.º 6
0
	def on_trash(self):
		self.setup_generator()
		if not self.website_template: return

		remove_sitemap(ref_doctype=self.doctype, docname=self.name)
Ejemplo n.º 7
0
 def on_trash(self):
     self.setup_generator()
     remove_sitemap(ref_doctype=self.doc.doctype, docname=self.doc.name)
Ejemplo n.º 8
0
    def on_trash(self):
        self.setup_generator()
        if not self.website_template: return

        remove_sitemap(ref_doctype=self.doctype, docname=self.name)