跳至内容
菜单
此问题已终结
1 回复
4216 查看

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?

形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
1
9月 20
7326
4
2月 25
2151
1
8月 24
1902
2
11月 24
3032
0
12月 23
1013