[FIX] Pagecount probelm while all objects print on same page and printing special...
authorNCH-OpenERP <>
Thu, 27 Aug 2009 10:04:54 +0000 (15:34 +0530)
committerHDA (OpenERP) <hda@tinyerp.com>
Thu, 27 Aug 2009 10:04:54 +0000 (15:34 +0530)
bzr revid: hda@tinyerp.com-20090827100454-ph1ffi4ulanykb7s

bin/report/render/rml2pdf/trml2pdf.py
bin/report/render/rml2pdf/utils.py

index d73b506..f4b70a2 100644 (file)
@@ -765,12 +765,12 @@ class _rml_template(object):
         r = _rml_flowable(self.doc,self.localcontext, images=self.images, path=self.path, title=self.title)
         story_cnt = 0
         for node_story in node_stories:
+            if story_cnt > 0:
+                fis.append(platypus.PageBreak())
             fis += r.render(node_story)
-            if self.localcontext:
-                story_cnt += 1
-                if story_cnt == len(self.localcontext['objects']):
-                    fis.append(PageCount())
-            fis.append(platypus.PageBreak())
+            story_cnt += 1
+        if self.localcontext:
+            fis.append(PageCount())
         self.doc_tmpl.build(fis)
 
 def parseNode(rml, localcontext = {},fout=None, images={}, path='.',title=None):
index cb44ee6..59724d7 100644 (file)
@@ -97,7 +97,7 @@ def _child_get(node, self=None, tagname=None):
 
 def _process_text(self, txt):
         if not self.localcontext:
-            return txt
+            return str2xml(txt)
         if not txt:
             return ''
         result = ''