improved for pageCount in like survey type report

bzr revid: apa@tinyerp.com-20101006115806-2ub94u9sfrspo9w8
This commit is contained in:
apa-tiny 2010-10-06 17:28:06 +05:30
parent f7cfb5c641
commit 382669fa1c
2 changed files with 11 additions and 2 deletions

View File

@ -70,6 +70,7 @@ class report_rml(report_int):
def __init__(self, name, table, tmpl, xsl):
super(report_rml, self).__init__(name)
self.table = table
self.pageCount=False
self.tmpl = tmpl
self.xsl = xsl
self.bin_datas = {}
@ -174,6 +175,13 @@ class report_rml(report_int):
return xml
def create_pdf(self, rml, localcontext = None, logo=None, title=None):
if not localcontext:
localcontext={}
if self.tmpl=='' and not self.pageCount:
self.pageCount=True
else:
self.pageCount=False
localcontext.update({'header':self.pageCount})
if logo:
self.bin_datas['logo'] = logo
else:

View File

@ -820,8 +820,9 @@ class TinyDocTemplate(platypus.BaseDocTemplate):
class _rml_template(object):
def __init__(self, localcontext, out, node, doc, images={}, path='.', title=None):
self.localcontext = localcontext
if not self.localcontext:
self.localcontext={'header':'internal'}
if not self.localcontext or not self.localcontext.get('header',False):
self.localcontext={}
self.localcontext.update({'header':'internal'})
self.images= images
self.path = path
self.title = title