← Back to team overview

openerp-community team mailing list archive

lp:~akretion-team/openerp-product-attributes/openerp-product-attributes-fix-view into lp:openerp-product-attributes

 

Benoit Guillot - http://www.akretion.com has proposed merging lp:~akretion-team/openerp-product-attributes/openerp-product-attributes-fix-view into lp:openerp-product-attributes.

Requested reviews:
  Product Core Editors (product-core-editors)

For more details, see:
https://code.launchpad.net/~akretion-team/openerp-product-attributes/openerp-product-attributes-fix-view/+merge/168461

This branch place each attribute in a group in the generated view. Without that, the labels are not visible in v7.O.

It fixes also the case of the texts fields.


-- 
https://code.launchpad.net/~akretion-team/openerp-product-attributes/openerp-product-attributes-fix-view/+merge/168461
Your team OpenERP Community is subscribed to branch lp:openerp-product-attributes.
=== modified file 'product_custom_attributes/product.py'
--- product_custom_attributes/product.py	2013-02-15 04:36:45 +0000
+++ product_custom_attributes/product.py	2013-06-10 14:24:35 +0000
@@ -91,12 +91,14 @@
         return {'type': 'ir.actions.act_window_close'}
 
     def _build_attribute_field(self, cr, uid, page, attribute, context=None):
-        parent = page
+        parent = etree.SubElement(page, 'group', colspan="2", col="4")
         kwargs = {'name': "%s" % attribute.name}
-        if attribute.ttype == 'many2many':
-            parent = etree.SubElement(page, 'group', colspan="2", col="4")
-            sep = etree.SubElement(parent, 'separator',
-                                    string="%s" % attribute.field_description, colspan="4")
+        if attribute.ttype in ['many2many', 'text']:
+            parent = etree.SubElement(parent, 'group', colspan="2", col="4")
+            sep = etree.SubElement(parent,
+                                   'separator',
+                                    string="%s" % attribute.field_description,
+                                    colspan="4")
             kwargs['nolabel'] = "1"
         if attribute.ttype in ['many2one', 'many2many']:
             kwargs['domain'] = "[('attribute_id', '=', %s)]" % attribute.attribute_id.id


Follow ups