Skip to Content
Menu
This question has been flagged
1 Reply
6406 Views

Dear all,

Could you please advise - what is the purpose for using of hr.employee.public model vs hr.employee model?

And what is the better way to keep them 'synced', as based on my observation - hr.employee.public model almost fully duplicates hr.employee model.

(Odoo 14 Enterprise)

Avatar
Discard
Best Answer

As per below commit:

Purpose
=======
1/ Robustness & security: right now it is not easy to understand and do something
   clean in term of security (hr people vs employees, private info vs public). A
   HR officer doesn't know if he can write something on the chatter. Currently, a
   note will be visible for all the employees who have access to the employee form
   view for example.
2/ In term of business, it makes sense to let a hr manages payroll stuff (contract,
   employees private information, ... and other employee see public information
   (résumé and work information)
Specification
=============
Introduce 2 new models:
- hr.employee.base (AbstractModel): This represents the basic skeleton
  model on which the shared fields and methods between the public and
  the private employees models.
- hr.employee.public (_auto=False): This is a sql view based on the
  employee values, readable for an internal user (i.e. an employee).
The model hr.employee is not readable anymore for an employee.
There are now 3 ways to access the employee data:
1/ From the hr.employee views. HR officer access rights are required
2/ From the public profile. The public data for an employee are accessible
   but can't be modified.
3/ From the 'My Profile' menu. A classic employee can access its own
   data from there, and can modify them.


https://github.com/odoo/odoo/commit/c9ca3761464413327d2beb697553a3ccd7eef4d1#diff-33ddee69d1c1bd54669215a2deaec654c1263d8532550905d12dac4c689f05cb


Avatar
Discard
Related Posts Replies Views Activity
1
May 23
1820
1
Apr 24
288
2
Aug 24
3106
2
Oct 22
2186