[FIX] res.partner.category: merge the 2 classes bearing the same name
authorOlivier Dony <odo@openerp.com>
Thu, 12 Jan 2012 10:50:43 +0000 (11:50 +0100)
committerOlivier Dony <odo@openerp.com>
Thu, 12 Jan 2012 10:50:43 +0000 (11:50 +0100)
The name conflict causes the second class to
shadow the first one, thus breaking future
references to the first one, including any
super() call inside it!
6.1 has 2-pass loading of models so we can
simply merge the two classes now, and get
rid of the issue.

bzr revid: odo@openerp.com-20120112105043-ij740gptzu4gv6tw

openerp/addons/base/res/res_partner.py

index cc6abb3..f4a36b4 100644 (file)
@@ -87,6 +87,7 @@ class res_partner_category(osv.osv):
         'active' : fields.boolean('Active', help="The active field allows you to hide the category without removing it."),
         'parent_left' : fields.integer('Left parent', select=True),
         'parent_right' : fields.integer('Right parent', select=True),
+        'partner_ids': fields.many2many('res.partner', 'res_partner_category_rel', 'category_id', 'partner_id', 'Partners'),
     }
     _constraints = [
         (osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
@@ -393,13 +394,6 @@ class res_partner_address(osv.osv):
 
 res_partner_address()
 
-class res_partner_category(osv.osv):
-    _inherit = 'res.partner.category'
-    _columns = {
-        'partner_ids': fields.many2many('res.partner', 'res_partner_category_rel', 'category_id', 'partner_id', 'Partners'),
-    }
-
-res_partner_category()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: