-
- Downloads
[IMP] Add employee profile
[IMP] hr_*: introduce the employee profile ================================ ## General Purpose We want an 'Employee profile' gathering every data about an employee. The main form view is modified to become this employee profile. A user can also see his own profile through the Preferences menu. The new profile replaces the current Preferences view if the `hr` module is installed and the current user is linked to an employee. The Profile will show the employee of the current company. A user should be able to see and edit his own profile. *Problem*: Many fields on hr.employee are protected by `groups="hr.group_hr_user"`. Therefore, a regular user cannot see or edit those fields. This protection must be bypassed to allow read/write access to the regular user's own data. A similar mechanism already exists for `res.users` (for Preferences) The better (least worst) solution found is to reuse this mechanism by adding related fields on `res.users`. Pros: - Don't change security access on hr.employee - Don't implement yet another custom security layer, risking to add new security breaches - A lot of fields are added by other modules on hr.employee. It would have required to integrate them with the custom security layer. - Fields added by other modules on the user's preferences view (normal view, not the profile) are automatically included in the employee's profile view. - Allow the hr.employee form view to be different than the user profile accessible through the Preferences menu. E.g. add custom buttons only relevant to the logged in user such as "Request a leave". Cons: - Each field from hr.employee that you want to appear on its profile must be added as a related field on res.users - Those related fields must be added to user's preferences view (duplicate views) - They also must be added to `SELF_[READABLE | WRITABLE]_FIELDS` Note: When the front-end loads the views it gets the list of available fields for the user (according to its access rights). Later, when the front-end wants to populate the view with data, it only asks to read those available fields. However, in this case, we want the user to be able to read/write its own data, even if they are protected by groups (groups are kept on the related fields on res.users). The front-end need to be made aware of those fields by sending all field definitions. ## Changed modules ### hr_attendance Adds a stat button to this employee profile showing the number of hours worked last month. Remove the Boolean computed field `manual_attendance`. This field is just a shortcut to add/remove the employee's user in the "Manual Attendance" group. The checkbox is confusing on the employee's form and this should be done through the normal group management screens. ### hr_presence Display the presence status on the employee kanban template. The status is a colored chip which can be green (present), orange (to define) or red (absent). Currently, the presence status is only computed when accessing the report view. As this commits displays it on the employee kanban, it should be updated more frequently. The state should not be updated every time the kanban view is loaded since the computation is a bit heavy. Instead: add a cron to update status every hour. -> The status is accurate on the report view (status is still updated when loading the view) -> The status in accurate at 1 hour on the kanban view ### [ADD] hr_attendance_presence Bridge module between `hr_attendance` and `hr_presence`. This PR integrates `hr_presence` module in the employee profile and adds the presence status on the employee kanban view. But `hr_attendance` adds at the same place a similar status icon for checkin/checkout. This bridge module makes the status from `hr_presence` invisible as `hr_attendance` should be the main presence control mechanism. Also, this commit adds the ability (through a new setting option) for `hr_presence` to take into account checkin/checkout to determine the presence status. ### l10n_be_hr_payroll integration with employee profile [ADD] hr_skills: Introduce a new module for employee resumé and skills ======================================================= Purpose ----------- Consultancy companies need resumé and skills of their consultants. For big projects, they often need to send them to their customers. These information are also useful to statistics. Specification ----------------- ### New models #### `hr.resume.line.type` Types of resumé lines. e.g. *Experience*, *Education*, *Hobbies* #### `hr.resume.line` It is a line in the resumé of an employee. #### `hr.skill` Name of a skill. e.g *French*, *Python*, *Piano* #### `hr.skill.type` Skills can belongs to a particular type. A skill type has skill levels associated. e.g. *Languages*, *Dev*, *Music* #### `hr.skill.level` Levels available for a particular skill type. Each level has a label and a progress (between 0 and 100) associated. e.g. *Intermediary (20%)*, *Advanced (85%)*, *Expert (100%)* #### `hr.employee.skill` These are skills which employees have. It links an employee with a particular skill and level. e.g. Mitchell has an *Intermediary* level in *Python* ### Access Rights Only a `hr_user` can create/edit `hr.resume.line.type`, `hr.skill`, `hr.skill.level`, `hr.skill.type`. If employees are allowed to edit their infos (setting), they can also create/edit `hr.resume.line`, `hr.employee.skill` for themselves. ### UI Resumé lines are displayed, grouped by type, in a new 'Resumé' tab in the employee form. Resumé lines can be reordered (handle widget) Emloyee skills are displayed in the Resumé tab, grouped by skill type. [IMP] hr, hr_holidays, hr_expense: Change onchange parent_id behaviour ========================================================= Purpose ----------- When the manager (parent_id) of an employee changes, it doesn't always mean that other responsibles (Leave responsible, expense responsible, coach) should also change. Specification ----------------- When changing the employee's manager, the leave responsible, the expense responsible and the coach should be changed only if the field was not set or if the responsible is the previous manager. In that case, they should be set to the new manager. Otherwise, it means the field was most probably set manually and it should be left unchanged. Task 1913089 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr closes odoo/odoo#30502
No related branches found
No related tags found
Showing
- addons/hr/__manifest__.py 2 additions, 1 deletionaddons/hr/__manifest__.py
- addons/hr/models/hr.py 62 additions, 28 deletionsaddons/hr/models/hr.py
- addons/hr/models/res_config_settings.py 2 additions, 0 deletionsaddons/hr/models/res_config_settings.py
- addons/hr/models/res_partner.py 14 additions, 0 deletionsaddons/hr/models/res_partner.py
- addons/hr/models/res_users.py 142 additions, 3 deletionsaddons/hr/models/res_users.py
- addons/hr/static/src/js/chat.js 71 additions, 0 deletionsaddons/hr/static/src/js/chat.js
- addons/hr/static/src/xml/hr_templates.xml 8 additions, 0 deletionsaddons/hr/static/src/xml/hr_templates.xml
- addons/hr/tests/__init__.py 1 addition, 0 deletionsaddons/hr/tests/__init__.py
- addons/hr/tests/test_self_user_access.py 122 additions, 0 deletionsaddons/hr/tests/test_self_user_access.py
- addons/hr/views/hr_templates.xml 1 addition, 0 deletionsaddons/hr/views/hr_templates.xml
- addons/hr/views/hr_views.xml 70 additions, 57 deletionsaddons/hr/views/hr_views.xml
- addons/hr/views/res_config_settings_views.xml 27 additions, 0 deletionsaddons/hr/views/res_config_settings_views.xml
- addons/hr/views/res_users.xml 152 additions, 0 deletionsaddons/hr/views/res_users.xml
- addons/hr_attendance/models/__init__.py 1 addition, 0 deletionsaddons/hr_attendance/models/__init__.py
- addons/hr_attendance/models/hr_employee.py 13 additions, 15 deletionsaddons/hr_attendance/models/hr_employee.py
- addons/hr_attendance/models/res_users.py 25 additions, 0 deletionsaddons/hr_attendance/models/res_users.py
- addons/hr_attendance/views/hr_attendance_view.xml 1 addition, 1 deletionaddons/hr_attendance/views/hr_attendance_view.xml
- addons/hr_attendance/views/hr_employee_view.xml 57 additions, 3 deletionsaddons/hr_attendance/views/hr_employee_view.xml
- addons/hr_attendance_presence/__init__.py 1 addition, 0 deletionsaddons/hr_attendance_presence/__init__.py
- addons/hr_attendance_presence/__manifest__.py 19 additions, 0 deletionsaddons/hr_attendance_presence/__manifest__.py
Loading
Please register or sign in to comment