Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4301 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 20
7429
4
thg 2 25
2348
1
thg 8 24
1981
2
thg 11 24
3170
0
thg 12 23
1054