示例#1
0
文件: item.py 项目: poses/erpnext
    def on_trash(self):
        webnotes.conn.sql("""delete from tabBin where item_code=%s""",
                          self.doc.item_code)

        if self.doc.page_name:
            from webnotes.webutils import clear_cache
            clear_cache(self.doc.page_name)
示例#2
0
    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)
示例#3
0
    def on_update(self):
        # make js and css
        # clear web cache (for menus!)
        self.set_home_page()

        from webnotes.webutils import clear_cache
        clear_cache()
示例#4
0
	def on_update(self):
		WebsiteGenerator.on_update(self)
		
		# clear all cache if it has toc
		if self.doclist.get({"parentfield": "toc"}):
			from webnotes.webutils import clear_cache
			clear_cache()
示例#5
0
	def on_update(self):
		# make js and css
		# clear web cache (for menus!)
		self.set_home_page()

		from webnotes.webutils import clear_cache
		clear_cache()
示例#6
0
def invalidate_cache_for(bean, trigger, item_group=None):
	if not item_group:
		item_group = bean.doc.name
	
	for i in get_parent_item_groups(item_group):
		if i.page_name:
			clear_cache(i.page_name)
示例#7
0
	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)
示例#8
0
    def on_trash(self):
        webnotes.conn.sql("""delete from tabBin where item_code=%s""", self.doc.item_code)

        if self.doc.page_name:
            from webnotes.webutils import clear_cache

            clear_cache(self.doc.page_name)
示例#9
0
	def on_trash(self):
		webnotes.conn.sql("""delete from tabBin where item_code=%s""", self.doc.item_code)
		webnotes.conn.sql("""delete from `tabStock Ledger Entry` 
			where item_code=%s and is_cancelled='Yes' """, self.doc.item_code)

		if self.doc.page_name:
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
示例#10
0
	def on_update(self):
		# make js and css
		from website.helpers.make_web_include_files import make
		make()
		
		# clear web cache (for menus!)
		from webnotes.webutils import clear_cache
		clear_cache()
示例#11
0
    def on_update(self):
        """clear web cache"""
        from webnotes.webutils import clear_cache
        clear_cache()

        if self.doc.default_product_category:
            webnotes.bean("Item Group",
                          self.doc.default_product_category).save()
示例#12
0
	def on_trash(self):
		webnotes.conn.sql("""delete from tabBin where item_code=%s""", self.doc.item_code)
		webnotes.conn.sql("""delete from `tabStock Ledger Entry` 
			where item_code=%s and is_cancelled='Yes' """, self.doc.item_code)

		if self.doc.page_name:
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
示例#13
0
	def on_update(self):
		WebsiteGenerator.on_update(self)
		self.if_home_clear_cache()
		
		# clear all cache if it has toc
		if self.doclist.get({"parentfield": "toc"}):
			from webnotes.webutils import clear_cache
			clear_cache()
示例#14
0
	def on_update(self):
		"""clear web cache"""
		from webnotes.webutils import clear_cache
		clear_cache()
		
		if self.doc.default_product_category:
			webnotes.bean("Item Group", 
				self.doc.default_product_category).save()
示例#15
0
    def on_update(self):
        if cint(self.doc.show_in_website):
            from webnotes.webutils import update_page_name
            update_page_name(self.doc, self.doc.partner_name)

        if self.doc.page_name:
            from webnotes.webutils import clear_cache
            clear_cache(self.doc.page_name)
            clear_cache("partners")
示例#16
0
	def on_update(self):
		if cint(self.doc.show_in_website):
			from webnotes.webutils import update_page_name
			update_page_name(self.doc, self.doc.partner_name)
		
		if self.doc.page_name:
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
			clear_cache("partners")
示例#17
0
	def on_trash(self):
		from webnotes.webutils import clear_cache
		
		# remove website sitemap permissions
		to_remove = webnotes.conn.sql_list("""select name from `tabWebsite Sitemap Permission` 
			where website_sitemap=%s""", (self.doc.name,))
		webnotes.delete_doc("Website Sitemap Permission", to_remove, ignore_permissions=True)
		
		clear_cache(self.doc.name)
示例#18
0
	def on_rename(self, newdn, olddn, merge=False):
		webnotes.conn.sql("update tabItem set item_code = %s where name = %s", (newdn, olddn))
		if self.doc.page_name:
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
			
		if merge:
			from stock.stock_ledger import update_entries_after
			for wh in webnotes.conn.sql("""select warehouse from `tabBin` 
				where item_code=%s""", newdn):
					update_entries_after({"item_code": newdn, "warehouse": wh})
示例#19
0
	def on_rename(self, newdn, olddn, merge=False):
		webnotes.conn.sql("update tabItem set item_code = %s where name = %s", (newdn, olddn))
		if self.doc.page_name:
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
			
		if merge:
			from stock.stock_ledger import update_entries_after
			for wh in webnotes.conn.sql("""select warehouse from `tabBin` 
				where item_code=%s""", newdn):
					update_entries_after({"item_code": newdn, "warehouse": wh[0]})
示例#20
0
	def on_trash(self):
		# delete entry from Table of Contents of other pages
		WebsiteGenerator.on_trash(self)
		
		webnotes.conn.sql("""delete from `tabTable of Contents`
			where web_page=%s""", self.doc.name)
		
		# clear all cache if it has toc
		if self.doclist.get({"parentfield": "toc"}):
			from webnotes.webutils import clear_cache
			clear_cache()
示例#21
0
	def if_home_clear_cache(self):
		"""if home page, clear cache"""
		if webnotes.conn.get_value("Website Settings", None, "home_page")==self.doc.name:
			if webnotes.conn.exists("Website Sitemap", "index"):
				webnotes.delete_doc("Website Sitemap", "index", ignore_permissions=True)
			WebsiteGenerator.on_update(self, page_name="index")

			from webnotes.sessions import clear_cache
			clear_cache('Guest')
			
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
			clear_cache('index')
示例#22
0
	def on_rename(self,newdn,olddn, merge=False):
		webnotes.conn.sql("update tabItem set item_code = %s where name = %s", (newdn, olddn))
		if self.doc.page_name:
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
示例#23
0
	def on_update(self):
		from webnotes.webutils import clear_cache
		clear_cache("contact")
示例#24
0
	def on_update(self):
		WebsiteGenerator.on_update(self)
		clear_cache("writers")
示例#25
0
文件: item.py 项目: pdvyas/erpnext
 def update_website_page_name(self):
     if self.doc.page_name:
         self.update_website()
         from webnotes.webutils import clear_cache
         clear_cache(self.doc.page_name)
示例#26
0
 def on_update(self):
     # for blog footer
     from webnotes.webutils import clear_cache
     clear_cache()
示例#27
0
	def on_update(self):
		# for blog footer
		from webnotes.webutils import clear_cache
		clear_cache()
		
示例#28
0
	def on_update(self):
		from webnotes.webutils import clear_cache
		clear_cache("blog")
		clear_cache("writers")
示例#29
0
 def on_update(self):
     from webnotes.webutils import clear_cache
     clear_cache("blog")
     clear_cache("writers")
示例#30
0
文件: item.py 项目: XWARIOSWX/erpnext
	def update_website_page_name(self):
		if self.doc.page_name:
			self.update_website()
			from webnotes.webutils import clear_cache
			clear_cache(self.doc.page_name)
示例#31
0
	def on_update(self):
		WebsiteGenerator.on_update(self)
		if self.doc.page_name:
			clear_cache("partners")
示例#32
0
 def on_update(self):
     from webnotes.webutils import clear_cache
     clear_cache("contact")
示例#33
0
def update_website_page_name(bean, trigger):
	if bean.doc.page_name:
		invalidate_cache_for_item(bean, trigger)
		clear_cache(bean.doc.page_name)
示例#34
0
 def on_update(self):
     # a slide show can be in use and any change in it should get reflected
     from webnotes.webutils import clear_cache
     clear_cache()
示例#35
0
def clear_blog_cache():
	for blog in webnotes.conn.sql_list("""select page_name from 
		`tabBlog Post` where ifnull(published,0)=1"""):
		clear_cache(blog)
	
	clear_cache("writers")
	def on_update(self):
		# a slide show can be in use and any change in it should get reflected
		from webnotes.webutils import clear_cache
		clear_cache()
示例#37
0
 def on_rename(self, newdn, olddn, merge=False):
     webnotes.conn.sql("update tabItem set item_code = %s where name = %s",
                       (newdn, olddn))
     if self.doc.page_name:
         from webnotes.webutils import clear_cache
         clear_cache(self.doc.page_name)