Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4813 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
lut 25
2314
1
sie 24
1963
2
lis 24
3137
3
paź 23
14675
2
lut 23
2366