Odoo Help

Welcome!

This community 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.

1

why hr.employee is not inherited with res.partner?

By
Amit Kumar
on 11/16/15, 4:47 AM 328 views

Hello,

I want to know the logic behind creating "hr.employee" model for employees. Why not employee should "res.partner".

When we create a employee one record is created in hr_employee, if we want to assign a user for every employee then we have to create a user and then a partner will automatically created. This created partner is not used in employee record but every time when we create a employee an extra partner is created that is not in used. So why hr.employee is not inherited with res.partner?

Please explain the logic behind it.  

2

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 11/16/15, 7:50 AM

Hello my friend;

The main class is in addons/base/res/res_users.py. In all the other models we just inherit the main class.

I think if you follow those links you will be able to get the answer and understand :) 

To clarify.

res.partner is an ORM Model. An ORM model describes a class of objects in the database and provides a series of ORM methods to allow you to manage them in code (create, write, unlink etc).

http://useopenerp.com/v8/model/res-partner

http://useopenerp.com/v8/model/res-users

http://useopenerp.com/v8/model/hr-employee

Regards.

Thank you for reply. These links I have already checked but I am not able understand the logic behind this concept. Support I have to create a module name school_management, and there are two types of person record like student and parent. My question is that student and parent record should be inherited with res.partner or I have to create separate record(class) for both. Every student and parent have user for login by website. So plz suggest me the proper way to do this without creating redundant record in database(like hr.employee record according to my root question ). Thanks

Amit Kumar
on 11/16/15, 2:21 PM

hello my friend, i did not understand very well what you want i need conceptional model if you want send me any thing you have about what you want and here is my mail: abdelwahed_rihene@yahoo.fr

Drees Far
on 11/17/15, 4:09 AM

Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/16/15, 4:47 AM
Seen: 328 times
Last updated: 11/16/15, 2:32 PM