Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
b9999b2698
@ -25,7 +25,7 @@ from webnotes import msgprint
|
|||||||
|
|
||||||
sql = webnotes.conn.sql
|
sql = webnotes.conn.sql
|
||||||
|
|
||||||
class DocType():
|
class DocType:
|
||||||
def __init__(self, doc, doclist=[]):
|
def __init__(self, doc, doclist=[]):
|
||||||
self.doc = doc
|
self.doc = doc
|
||||||
self.doclist = doclist
|
self.doclist = doclist
|
||||||
@ -38,9 +38,13 @@ class DocType():
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
# webpage updates
|
if self.doc.show_in_website:
|
||||||
from website.utils import update_page_name
|
# webpage updates
|
||||||
update_page_name(self.doc, self.doc.item_name)
|
from website.utils import update_page_name
|
||||||
|
update_page_name(self.doc, self.doc.item_name)
|
||||||
|
elif self.doc.page_name:
|
||||||
|
from website.web_cache import clear_cache
|
||||||
|
clear_cache(self.doc.page_name)
|
||||||
|
|
||||||
bin = sql("select stock_uom from `tabBin` where item_code = '%s' " % self.doc.item_code)
|
bin = sql("select stock_uom from `tabBin` where item_code = '%s' " % self.doc.item_code)
|
||||||
if bin and cstr(bin[0][0]) != cstr(self.doc.stock_uom):
|
if bin and cstr(bin[0][0]) != cstr(self.doc.stock_uom):
|
||||||
@ -80,8 +84,10 @@ class DocType():
|
|||||||
sql("""delete from `tabStock Ledger Entry`
|
sql("""delete from `tabStock Ledger Entry`
|
||||||
where item_code=%s and is_cancelled='Yes' """, self.doc.item_code)
|
where item_code=%s and is_cancelled='Yes' """, self.doc.item_code)
|
||||||
|
|
||||||
self.delete_web_cache(self.doc.page_name)
|
if self.doc.page_name:
|
||||||
|
from website.web_cache import clear_cache
|
||||||
|
clear_cache(self.doc.page_name)
|
||||||
|
|
||||||
# Check whether Ref Rate is not entered twice for same Price List and Currency
|
# Check whether Ref Rate is not entered twice for same Price List and Currency
|
||||||
def check_ref_rate_detail(self):
|
def check_ref_rate_detail(self):
|
||||||
check_list=[]
|
check_list=[]
|
||||||
@ -192,6 +198,9 @@ class DocType():
|
|||||||
|
|
||||||
def on_rename(self,newdn,olddn):
|
def on_rename(self,newdn,olddn):
|
||||||
sql("update tabItem set item_code = %s where name = %s", (newdn, olddn))
|
sql("update tabItem set item_code = %s where name = %s", (newdn, olddn))
|
||||||
|
if self.doc.page_name:
|
||||||
|
from website.web_cache import clear_cache
|
||||||
|
clear_cache(self.doc.page_name)
|
||||||
|
|
||||||
def prepare_template_args(self):
|
def prepare_template_args(self):
|
||||||
self.doc.web_description_html = self.doc.description or ''
|
self.doc.web_description_html = self.doc.description or ''
|
||||||
|
@ -19,7 +19,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
import website.utils
|
import website.utils
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ def get_outer_env():
|
|||||||
'favicon': webnotes.conn.get_value('Website Settings', None, 'favicon')
|
'favicon': webnotes.conn.get_value('Website Settings', None, 'favicon')
|
||||||
}
|
}
|
||||||
|
|
||||||
def clear_cache(page_name, doc_type=None, doc_name=None):
|
def clear_cache(page_name):
|
||||||
if page_name:
|
if page_name:
|
||||||
delete_page_cache(page_name)
|
delete_page_cache(page_name)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user