diff --git a/addons/product/product.py b/addons/product/product.py index 874680cb17d..4df455e7409 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -218,6 +218,8 @@ class product_category(osv.osv): 'child_id': fields.one2many('product.category', 'parent_id', string='Child Categories'), 'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of product categories."), 'type': fields.selection([('view','View'), ('normal','Normal')], 'Category Type'), + 'parent_left': fields.integer('Left Parent', select=1), + 'parent_right': fields.integer('Right Parent', select=1), } @@ -225,7 +227,11 @@ class product_category(osv.osv): 'type' : lambda *a : 'normal', } - _order = "sequence, name" + _parent_name = "parent_id" + _parent_store = True + _parent_order = 'sequence, name' + _order = 'parent_left' + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids):