This question has been flagged
1 Reply
3928 Views

Hello everyone,

I ask this question because I don't find the answer in the memento and the developper book, I want to know the order.

We have this class on module base:

class res_partner(osv.osv):
    _description = 'Partner'
    _name = "res.partner"

    def create(self, cr, ....
...
res_partner()

I inherit from the first module module1 the class res_partner() as :

class res_partner(osv.osv):
    _description = 'Partner'
    _inherit = "res.partner"

    def create(self, cr, ....
        return super(res_parner, self).create(cr, ...
...
res_partner()

I inherit in a second module module2 from res_partner() as :

class res_partner(osv.osv):
    _description = 'Partner'
    _inherit = "res.partner"

    def create(self, cr, ....
        return super(res_parner, self).create(cr, ...
...
res_partner()

Now when I call create from the last module module2 how can make it call the create of module1 ? and how to call the create of module base without passing by inheritance ?

Best regards

Avatar
Discard
Best Answer

I'm not sure if this accomplishes what you need, but have you played around with the 'depends' option in the __openerp__.py file? You could try having module2 depend on module1. Just a thought - I'm still a newbie.

Avatar
Discard