Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4800 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
feb 25
2309
1
ago 24
1962
2
nov 24
3134
3
oct 23
14673
2
feb 23
2364