Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
This seems like it probably has a basic answer, but its left me baffled. Why do users (res.users) and companies (res.company) each have a many2one 'partner_id' field? From my testing it seems this corresponding partner is what is used to check access rights rather than the user/company itself. But users and companies inherit from res.partner anyway...so why do they need this separate partner object linked to them?
Can anyone tell me what I am missing here?
For generalization purposes
res.partner is used for personal data, regardless whether this is a customer, supplier, company or a user. This makes sense, because otherwise contact data will be spread over several tables. So there is for example only one E-Mail field in the whole system.
res.company does not inherit form
res.user inherits from res.partner, but there are 2 types of inheritance (see Developer Docu)
res.user uses the second type, it only is related to a
partner_id. But the fields of
res.partner are not directly accessible (with
_inherit they would be directly accessible, but the fields would then also be in the
_inherits in this case assures that the contact data stay in DB table
res_partner instead of
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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
|Asked: 3/3/13, 10:51 PM|
|Seen: 1925 times|
|Last updated: 3/16/15, 8:10 AM|