Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4261 Visualizzazioni

If I extend res.partner with two different custom addons how does Odoo prioritize which one applies first. For example, I might overwrite the original create method in both extensions like so:

class extend_partner(openerp.models.Model):
     _inherit = 'res.partner'
     
     @api.model
     def create(self):
         res = super(extend_partner, self).create(vals)
         # do custom stuff
         return res

What happens when I have two of the above extensions and the "#do custom stuff" code block conflicts or should be done in a certain order? Is there any place in the documentation that explains this in detail?

Avatar
Abbandona
Risposta migliore

Did you ever figure this out? I now find myself with a similar situation. I need my module to be able to reference a field created by a module that inherits from a core model. When I try to reference it in my create method, the field is not yet available.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
set 20
7388
4
feb 25
2289
1
ago 24
1950
2
nov 24
3112
0
dic 23
1034