[FIX] bug in report engine
authorFabien Pinckaers <fp@tinyerp.com>
Fri, 12 Jun 2009 14:11:53 +0000 (16:11 +0200)
committerFabien Pinckaers <fp@tinyerp.com>
Fri, 12 Jun 2009 14:11:53 +0000 (16:11 +0200)
lp bug: https://launchpad.net/bugs/385297 fixed

bzr revid: fp@tinyerp.com-20090612141153-72tcjwwugwugouww

bin/addons/base/res/partner/partner.py
bin/addons/base/res/partner/partner_view.xml
bin/report/render/rml2pdf/utils.py

index 6f2b513..33c1e7d 100644 (file)
@@ -134,6 +134,7 @@ class res_partner(osv.osv):
     _columns = {
         'name': fields.char('Name', size=128, required=True, select=True),
         'date': fields.date('Date', select=1),
+        'sale_ids': fields.one2many('sale.order', 'partner_id', 'Sales'),
         'title': fields.selection(_partner_title_get, 'Title', size=32),
         'parent_id': fields.many2one('res.partner','Main Company', select=2),
         'child_ids': fields.one2many('res.partner', 'parent_id', 'Partner Ref.'),
index 127a44e..a4c45fc 100644 (file)
                         <field name="lang" select="2"/>
                         <field name="supplier" select="2"/>
                     </group>
+                    <field name="sale_ids" colspan="4"/>
                     <notebook colspan="4">
                         <page string="General">
                             <field colspan="4" mode="form,tree" name="address" nolabel="1" select="1">
index 9aed08e..65fb236 100644 (file)
@@ -103,13 +103,14 @@ def _process_text(self, txt):
             result += self.localcontext.get('translate', lambda x:x)(sps.pop(0))
             if sps:
                 try:
-                    txt2 = str2xml(eval(sps.pop(0),self.localcontext))
+                    txt = eval(sps.pop(0),self.localcontext)
                 except:
-                    txt2 = ''
-                if type(txt2)==type('') or type(txt2)==type(u''):
+                    pass
+                if type(txt)==type('') or type(txt)==type(u''):
+                    txt2 = str2xml(txt)
                     result += txt2
-                elif (txt2 is not None) and (txt2 is not False):
-                    result += str(txt2)
+                elif (txt is not None) and (txt is not False):
+                    result += str(txt)
         return result
 
 def text_get(node):