grasbauer committed bb7fc5f

Sortin of attributes fixed

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">
                 <tree string="Product Attributes" sequence="sequence">
-                <field name="sequence"/>
+                <field name="sequence" tree_invisible="1"/>
                 <field name="name"/>
                 <field name="values"/>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.