mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 21:49:18 +00:00
account_browser: remove can_create check
This commit is contained in:
@@ -17,6 +17,40 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def render(page_name):
|
||||
"""render html page"""
|
||||
import webnotes
|
||||
try:
|
||||
if page_name:
|
||||
html = get_html(page_name)
|
||||
else:
|
||||
html = get_html('index')
|
||||
except Exception, e:
|
||||
html = get_html('404')
|
||||
|
||||
from webnotes.handler import eprint, print_zip
|
||||
eprint("Content-Type: text/html")
|
||||
print_zip(html)
|
||||
|
||||
def get_html(page_name):
|
||||
"""get page html"""
|
||||
page_name = scrub_page_name(page_name)
|
||||
comments = get_comments(page_name)
|
||||
|
||||
import website.web_cache
|
||||
html = website.web_cache.get_html(page_name, comments)
|
||||
return html
|
||||
|
||||
def get_comments(page_name):
|
||||
import webnotes
|
||||
|
||||
if page_name == '404':
|
||||
comments = """error: %s""" % webnotes.getTraceback()
|
||||
else:
|
||||
comments = """page: %s""" % page_name
|
||||
|
||||
return comments
|
||||
|
||||
def scrub_page_name(page_name):
|
||||
if page_name.endswith('.html'):
|
||||
page_name = page_name[:-5]
|
||||
@@ -41,37 +75,3 @@ def page_name(title):
|
||||
name = title.lower()
|
||||
name = re.sub('[~!@#$%^&*()<>,."\']', '', name)
|
||||
return '-'.join(name.split()[:4])
|
||||
|
||||
def render(page_name):
|
||||
"""render html page"""
|
||||
import webnotes
|
||||
try:
|
||||
if page_name:
|
||||
html = get_html(page_name)
|
||||
else:
|
||||
html = get_html('index')
|
||||
except Exception, e:
|
||||
html = get_html('404')
|
||||
|
||||
from webnotes.handler import eprint, print_zip
|
||||
eprint("Content-Type: text/html")
|
||||
print_zip(html)
|
||||
|
||||
def get_html(page_name):
|
||||
"""get page html"""
|
||||
page_name = scrub_page_name(page_name)
|
||||
comments = get_comments(page_name)
|
||||
|
||||
import website.web_cache
|
||||
html = website.web_cache.get_html(page_name, comments)
|
||||
return html
|
||||
|
||||
def get_comments(page_name):
|
||||
import webnotes
|
||||
|
||||
if page_name == '404':
|
||||
comments = """error: %s""" % webnotes.getTraceback()
|
||||
else:
|
||||
comments = """page: %s""" % page_name
|
||||
|
||||
return comments
|
||||
|
||||
@@ -31,6 +31,7 @@ def get_html(page_name, comments=''):
|
||||
# load from cache, if auto cache clear is falsy
|
||||
if not (hasattr(conf, 'auto_cache_clear') and conf.auto_cache_clear or 0):
|
||||
html = load_from_cache(page_name)
|
||||
comments += "\n\npage load status: from cache"
|
||||
|
||||
if not html:
|
||||
html = load_into_cache(page_name)
|
||||
@@ -82,7 +83,8 @@ def get_predefined_pages():
|
||||
import conf
|
||||
import website.utils
|
||||
|
||||
pages_path = os.path.join(os.path.dirname(conf.__file__), 'app', 'website', 'templates', 'pages')
|
||||
pages_path = os.path.join(os.path.dirname(conf.__file__), 'app',
|
||||
'website', 'templates', 'pages')
|
||||
|
||||
page_list = []
|
||||
|
||||
@@ -121,7 +123,8 @@ def get_home_page():
|
||||
|
||||
def get_doc_fields(page_name):
|
||||
import webnotes
|
||||
doc_type, doc_name = webnotes.conn.get_value('Web Cache', page_name, ['doc_type', 'doc_name'])
|
||||
doc_type, doc_name = webnotes.conn.get_value('Web Cache', page_name,
|
||||
['doc_type', 'doc_name'])
|
||||
|
||||
import webnotes.model.code
|
||||
obj = webnotes.model.code.get_obj(doc_type, doc_name)
|
||||
|
||||
Reference in New Issue
Block a user