Odoo Help

0

0
1 Jawaban
1
Avatar

Jérémy Kersten (jke) Belgia

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

6327
| 4 4 11
Jodoigne, Belgia
--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) Belgia
16/02/17 16.30

Hi Pascal,


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

https://www.odoo.com/documentation/10.0/reference/orm.html#odoo.models.Model._inherits

https://www.odoo.com/documentation/10.0/reference/orm.html#inheritance-and-extension


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 Komentar
La Page PT, Pascal Tremblay Kanada
17/02/17 14.50

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

Mengajukan pertanyaan
Writer
Keep Informed
2 Follower(s)
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.

Register
Odoo Training Center

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

Test it now