mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
clear cache in website
This commit is contained in:
@@ -32,11 +32,13 @@ class DocType(DocTypeNestedSet):
|
|||||||
# webpage updates
|
# webpage updates
|
||||||
from website.utils import update_page_name
|
from website.utils import update_page_name
|
||||||
page_name = self.doc.name
|
page_name = self.doc.name
|
||||||
if webnotes.conn.get_value("Website Settings", None,
|
if webnotes.conn.get_value("Product Settings", None,
|
||||||
"default_product_category")==self.doc.name:
|
"default_product_category")==self.doc.name:
|
||||||
page_name = "products"
|
page_name = "products"
|
||||||
|
from website.utils import clear_cache
|
||||||
|
clear_cache()
|
||||||
|
|
||||||
update_page_name(self.doc, self.doc.name)
|
update_page_name(self.doc, page_name)
|
||||||
|
|
||||||
from website.helpers.product import invalidate_cache_for
|
from website.helpers.product import invalidate_cache_for
|
||||||
invalidate_cache_for(self.doc.name)
|
invalidate_cache_for(self.doc.name)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-12-07 15:15:28",
|
"creation": "2012-12-07 15:15:28",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-12-27 10:38:02"
|
"modified": "2012-12-27 18:50:20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"read_only": 1,
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "Page Name",
|
"label": "Page Name",
|
||||||
"fieldname": "page_name",
|
"fieldname": "page_name",
|
||||||
|
|||||||
@@ -15,4 +15,8 @@ class DocType:
|
|||||||
emp = webnotes.doc("Employee", d.employee)
|
emp = webnotes.doc("Employee", d.employee)
|
||||||
emp.image = url_for_website(emp.image)
|
emp.image = url_for_website(emp.image)
|
||||||
emp_list.append(emp)
|
emp_list.append(emp)
|
||||||
self.doclist += emp_list
|
self.doclist += emp_list
|
||||||
|
|
||||||
|
def on_update(self):
|
||||||
|
from website.utils import clear_cache
|
||||||
|
clear_cache("about")
|
||||||
@@ -14,4 +14,8 @@ class DocType:
|
|||||||
else:
|
else:
|
||||||
self.doc.query_options = ["Sales", "Support", "General"]
|
self.doc.query_options = ["Sales", "Support", "General"]
|
||||||
if self.doc.address:
|
if self.doc.address:
|
||||||
self.address = webnotes.model_wrapper("Address", self.doc.address).doc
|
self.address = webnotes.model_wrapper("Address", self.doc.address).doc
|
||||||
|
|
||||||
|
def on_update(self):
|
||||||
|
from website.utils import clear_cache
|
||||||
|
clear_cache("about")
|
||||||
@@ -5,4 +5,9 @@ import webnotes
|
|||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, d, dl):
|
def __init__(self, d, dl):
|
||||||
self.doc, self.doclist = d, dl
|
self.doc, self.doclist = d, dl
|
||||||
|
|
||||||
|
def on_update(self):
|
||||||
|
"""clear web cache"""
|
||||||
|
from website.utils import clear_cache
|
||||||
|
clear_cache()
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
{
|
{
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-12-20 14:05:00",
|
"creation": "2012-12-27 11:46:18",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-12-20 15:46:15"
|
"modified": "2012-12-27 18:51:38"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
@@ -38,6 +38,21 @@
|
|||||||
"name": "Product Settings",
|
"name": "Product Settings",
|
||||||
"doctype": "DocType"
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"label": "Help",
|
||||||
|
"fieldname": "help",
|
||||||
|
"fieldtype": "HTML",
|
||||||
|
"options": "<div class=\"alert\">To start adding products on the website, check \"Show in Website\" in <b>Item</b> and <b>Item Group</b></div>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "This Item Group represents \"products.html\"",
|
||||||
|
"doctype": "DocField",
|
||||||
|
"label": "Default Product Category",
|
||||||
|
"fieldname": "default_product_category",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Item Group"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "Default: \"Product Search\"",
|
"description": "Default: \"Product Search\"",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
|
|||||||
@@ -46,4 +46,4 @@ class DocType:
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
"""rebuild pages"""
|
"""rebuild pages"""
|
||||||
from website.helpers.make_web_include_files import make
|
from website.helpers.make_web_include_files import make
|
||||||
make()
|
make()
|
||||||
Reference in New Issue
Block a user