Commits

grasbauer  committed bb7fc5f

Sortin of attributes fixed

  • Participants
  • Parent commits 1660912

Comments (0)

Files changed (2)

         })
 
     def create(self, values):
-        if values.has_key('template') and not values['template']:
+        if not values.get('template'):
             values = values.copy()
-            values.pop('template')
+            try:values.pop('template')
+            except:pass
         return super(Product, self).create(values)
 
     def delete(self, ids):
     _description = __doc__
 
     sequence = fields.Integer('Sequence')
-    name = fields.Char('Name', required=True, translate=True, select=1)
+    name = fields.Char('Name', required=True, translate=True, select=1,
+                       order_field="%(table)s.sequence %(order)s")
     values = fields.One2Many('product.attribute.value', 'attribute', 'Values')
 
     def __init__(self):
             <field name="arch" type="xml">
                 <![CDATA[
                 <tree string="Product Attributes" sequence="sequence">
-                <field name="sequence"/>
+                <field name="sequence" tree_invisible="1"/>
                 <field name="name"/>
                 <field name="values"/>
                 </tree>