[FIX] account: invoices - missing field in tree view
authorARA (OpenERP) <ara@tinyerp.com>
Fri, 29 Apr 2011 08:53:55 +0000 (14:23 +0530)
committerARA (OpenERP) <ara@tinyerp.com>
Fri, 29 Apr 2011 08:53:55 +0000 (14:23 +0530)
bzr revid: ara@tinyerp.com-20110429085355-uysrsn2scz8dsctt

addons/account/account_invoice_view.xml
addons/account/invoice.py

index ede327f..ed45c70 100644 (file)
                     <field name="date_invoice"/>
                     <field name="number"/>
                     <field name="partner_id" groups="base.group_user"/>
-                    <field name="reference"/>
+                    <field name="reference" invisible="1"/>
                     <field name="name"/>
                     <field name="journal_id" invisible="1"/>
                     <field name="period_id" invisible="1" groups="account.group_account_user"/>
index a8fe0ba..679799f 100644 (file)
@@ -319,11 +319,11 @@ class account_invoice(osv.osv):
                     doc.remove(node)
 
         if view_type == 'tree':
-            partner_string = _('Supplier')
-            if context.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
-                partner_string = _('Customer')
+            partner_string = _('Customer')
+            if context.get('type', 'out_invoice') in ('in_invoice', 'in_refund'):
+                partner_string = _('Supplier')
                 for node in doc.xpath("//field[@name='reference']"):
-                    doc.remove(node)
+                    node.set('invisible', '0')
             for node in doc.xpath("//field[@name='partner_id']"):
                 node.set('string', partner_string)
         res['arch'] = etree.tostring(doc)