Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4819 Представления

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

Аватар
Отменить
Лучший ответ

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.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
4
февр. 25
2326
1
авг. 24
1969
2
нояб. 24
3147
3
окт. 23
14685
2
февр. 23
2372