Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the relationship between res.partner and res.user?

I am new to odoo v8 and i am not able to understand the relationship between res_partner and res_users tables and also with hr_employee table are they all related?

like image 745
DarkSide Avatar asked Oct 25 '25 15:10

DarkSide


2 Answers

The relationship between res.partner and res.user is that res.user inherits from res.partner using an inheritance type called "Delegation Inheritance" (see documentation).

Because of "Delegation Inheritance" every res.user record has a mandatory internal connection to a corresponding res.partner record using a field partner_id. What is this connection all about is to directly use all the fields of res.partner to store data shared by res.user and res.partner (i.e. name, phone, etc... if for example you refer to phone property of a record of res.user you'll get the value stored in the corresponding res.partner record) so res.user has to define fewer number of fields on it's own, like password, login, etc..

Note also that because of this relation res.user can NOT exist in the system without corresponding res.partner, it's why every res.user has one, but nonetheless res.partner can exist without res.user.

like image 188
T.V. Avatar answered Oct 28 '25 02:10

T.V.


  1. hr.employee have m21 with res.users (user_id) enter image description here
  2. res.users have m21 with res.partner(partner_id) enter image description here
like image 29
Prakash Kumar Avatar answered Oct 28 '25 03:10

Prakash Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!