Odoo Ajuda


1 Resposta

Jérémy Kersten (jke) Bélgica

--Jérémy Kersten (jke)--

| 4 4 11
Jodoigne, Bélgica
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013.

He is now the Team Leader of the Website Team and support of our own website odoo.com.

Jérémy Kersten (jke) Bélgica
16/02/17 16:30

Hi Pascal,

you can find more information about inheritance in the doc...



As you can see, this field is declared on res.partner: https://github.com/odoo/odoo/blob/10.0/odoo/addons/base/res/res_partner.py#L177

And on res_users, you have the partner_id whith delegation inheritance (inheritS): https://github.com/odoo/odoo/blob/10.0/odoo/addons/base/res/res_users.py#L175

class Users(models.Model):
    _name = "res.users"
    _inherits = {'res.partner': 'partner_id'}

As explain, with inherits: "implements composition-based inheritance: the new model exposes all the fields of the _inherits-ed model but stores none of them: the values themselves remain stored on the linked record."

so if partner has field 'foo'.

user.foo ====> user.partner_id.foo

1 Comentário
La Page PT, Pascal Tremblay Canadá
17/02/17 14:50

This is great! I didn't know this concept! All your explanations are clear! Big thanks for that!

Faça uma Pergunta
Keep Informed
2 seguidor (es)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now