Commit Graph
276 Commits
Author SHA1 Message Date
Noe Antoine a8b5a53e60 [REF][ADD] hr: split appointment module according to hr dependancy
When setting users on the appointment type as staff, we want to consider
their resource_calendar_id (work schedules) only if they correspond to the
current company and are linked to employees, not the ones linked to the users
directly. In order to display those work hours correctly, we use a new related
field on the employee_id in res_users model as it will return the employee of
the user in the current company, if any.

Therefore, we add the new field employee_resource_calendar_id directly in
hr module (in res.users model) to reduce diff and centralize the fields as
close as possible to the employee_id definition.

--- Links ---
Task-2499566

closes odoo/odoo#82234

Related: odoo/enterprise#17934
Related: odoo/upgrade#2578
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-05 09:52:07 +00:00
William Braeckman 2b78d430b8 [IMP] hr: add a new field to query members of department
Adds a new non stored field to make it easier to query all employees
from the active user's department and it's children department(s).
The result is guaranteed to always contain the active user's employee.

task-2700231

closes odoo/odoo#81472

Related: odoo/enterprise#22724
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-01-05 08:57:44 +00:00
roen-odoo 927dd2d371 [FIX] hr: Cannot acces profile without right
Current behavior:
When a user doesn't have any HR access right he cannot access his own profile

Steps to reproduce:
-Go to the demo user settings
-Remove all the right in the HR section
-Log into demo account
-Try to access My Profile

opw-2712593

closes odoo/odoo#81674

X-original-commit: ee932eab329043a3ddf82bb39dff458f4eb7f7ad
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2021-12-20 16:53:05 +00:00
Kevin Baptiste 9c5694e929 [IMP] hr: make tags visible/editable by Officer
The tags management on an employee was limited to HR Administrator,
which didn't make sense as an HR Officer could manage the tags just not
assign them to an employee.

closes odoo/odoo#81654

Taskid: 2715498
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-20 16:52:54 +00:00
William Braeckman 4902075e3d [IMP] hr: allow users to edit their settings in multi-company contexts
Before this commit users were not able to edit their settings if they
had a linked employee for a company that was not currently active for
them.
This is due to the fact that since the employee_ids field is considered
`safe` to read/write by your own user the fields were loaded in sudo and
thus bypassed the security rules that were meant to prevent that issue.
The security rule is now enforced as a domain on the `employee_ids`.

TaskId-2715341

closes odoo/odoo#81612

X-original-commit: b5b105eabd90419a5856e8279e277743c5915fc9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2021-12-17 16:58:10 +00:00
Jeremy Kersten de29bae3ee [FIX] hr: don't use .write() in a computed method
Before this commit, the computed field _compute_is_system make a write which
one is a bad practice and trigger a lot of others calls on res.user model.

opw-2716468

closes odoo/odoo#81555

X-original-commit: f85a67935c5dfa660e94f9bed8e8058c8df256cc
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2021-12-17 08:29:41 +00:00
Yannick TivisseandVictor Feyens 18952cdc76 [IMP] *: Convert single create method into multi
Taskid: 2703085
Part-of: odoo/odoo#80824
Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-12-14 19:13:18 +00:00
Thibault Libioulle 74624f43ee [REF] resource,hr{,_contract}: obtain calendar validity per resource
This commit adds methods to easily obtain calendar validity per resource
for a given search period and get the work intervals per resource,
taking into account the validity of their calendars.

In hr, the create and departure date of an employee are taken into
account to compute the calendars validity.

In hr_contract, it looks for every contract of human resources with
employee of type student or employee existing in the search period and
consider the specific calendar of the contract as valid during the
contract-lifetime.

PR: #77362

task-2646630
2021-11-30 12:20:47 +01:00
Bonis ModiandKartik Chavda f4c054e473 [IMP] project, hr_timesheet, *: improve generic ux
Purpose of this commit to improve generic UX for the project app.

So, In this commit done following changes:

- add 'subtask_effective_hours' and 'total_hours_spent' fields in the page of
subtask in task form view.
- change invisible attrs to column_invisible attrs for block_by page in task
form view.
- add 'task in progress' subtype for project.task and move 'stage changed'
subtype above 'task blocked'.
- remove the 'is_close' field and all its references from project.task.type.
- unarchive all of its tasks when the user unarchives the task stage.
- sort projects on 'is_favorite'.
- internal users following the project automatically follow its updates and
their notification preferences propagated accordingly.
- duplicating a task will duplicate all of its subtasks.
- move parent task field in extra info page of task form view.
- change the label of 'edit' to 'view' in the burger menu of project kanban view.
- user can delete task without sale_order validation error.
- add constraints for 'seller_ids' field.
- add remaining_hours_so field in task tree view.
- add unusual_days in task calendar view.
- add 'no content helper' in action of burndown chart.

task-2536044

closes odoo/odoo#74018

Related: odoo/enterprise#19880
Related: odoo/upgrade#2801
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Co-authored-by: Kartik Chavda <kcv@odoo.com>
2021-11-23 12:04:00 +00:00
Philippe Wauthy 35b4df7389 [IMP] hr: display employees kanban from department
Currently on the HR employee form, clicking on the department displays the default form of the department.
Instead, it should display the kanban view of the employees who are part of the department

task-2678198

closes odoo/odoo#79339

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-18 18:00:58 +00:00
Kevin Baptiste 3cad69a838 [IMP] hr: make Plan company dependent
It was possible to assign a user that was not part of the same company
as the employee's for an activity which is misleading.

Make hr.plan and hr.plan.activity.type company dependent.

closes odoo/odoo#77524

Related: odoo/upgrade#2879
Taskid: 2658773
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-15 07:24:38 +00:00
Kevin Baptiste 5437dbf5dc [FIX] hr: fix avatar generation on employee rename
It was not possible to rename an employee with an existing image
profile, as it was trying to assign the size of the avatar (coming from
the webclient) as the avatar itself.

closes odoo/odoo#78299

Taskid: 2660773
X-original-commit: 425ddb217664ba3fdae9e8c1527317fee0fe9368
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-13 15:22:56 +00:00
Pierrot (prro) 8f6d24a12b [FIX] hr: mark offline employee status
How to reproduce the problem:
- Install the Employees app
- Create a new user and create an employee form for this user
- Log in with this user, then log out
- On the user's Employees form, the employee still appears as connected

Cause of the problem : as soon as a user logs in,
the system saves the date of his last connection. That value was wrongly
used in the process of computing the user's status.

Now, if the user is offline, he is shown as "Not Available" or "Away"
(grey or orange).

opw-2623386

closes odoo/odoo#77545

X-original-commit: e2991ff6121fee790ef6ead1354cec250428835c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-01 06:28:59 +00:00
sofiagvaladze 415ab27126 [IMP] hr_holidays: Time Off smartbutton
task - 2634892

closes odoo/odoo#75941

Related: odoo/upgrade#2852
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-29 08:32:44 +00:00
sofiagvaladze b320c789a0 [IMP] hr:revert plan automation on triggers
task - 2628793

closes odoo/odoo#75528

Related: odoo/enterprise#20430
Related: odoo/upgrade#2776
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-27 17:43:23 +00:00
Yannick Tivisse 24713b76b5 [REV] fleet: Revert multiple fleet mechanism
I don't get why you don't get it...

Partial revert of the taskID: 2415309
Com PR: https://github.com/odoo/odoo/pull/70313
Ent PR: https://github.com/odoo/enterprise/pull/18114
Upg PR: https://github.com/odoo/upgrade/pull/2447

closes odoo/odoo#75475

Related: odoo/enterprise#20406
Related: odoo/upgrade#2765
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-25 12:20:39 +00:00
Martin Trigaux d9e3aab69b [FIX] mail: convert res_model_id to selection
Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.

Before this commit, a project user could not access the Activity Type
menu.

Convert it to a selection field with the selection values being
computed in sudo.

closes odoo/odoo#74981

Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-23 06:56:00 +00:00
William Braeckman cad3a0c6a0 [FIX] hr: prevent traceback when loading calendar views.
When loading calendar views, the client tries to load 'unusual' days,
linked to the employee of the current user. But it does not check that
the current user is linked to an employee for that company.

Closes odoo/odoo#75305

Task ID: 2628736

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-08-19 10:11:59 +00:00
Sébastien Theys 4cd70f164e [IMP] mail, hr, hr_holidays, *: batch mail partner format
* = test_discuss_full

Overall less queries.

Changes:

- Batch `mail_partner_format`.
- Batch `user.employee_id` compute.
- Remove query for current leave state, use fields (and prefetch) instead.
- Move current leave state in partner format instead of channel info.

Part of task-2622462

closes odoo/odoo#73174

Related: odoo/enterprise#20186
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-12 15:22:59 +00:00
William Braeckman 1aed8b70f5 [IMP] hr: departure wizard
Improve the departure wizard form view aswell as the flow when using it.
Removes the confirmation dialog when archiving an employee to directly
display the departure wizard.
Also changes departure reason to an html field instead of pure text.

Task ID: 2575279

closes odoo/odoo#72367

Related: odoo/enterprise#19116
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-03 14:36:02 +00:00
Barad Mahendra 639a3d0fcc [IMP] project,hr: generic improvement for the project
Purpose of the commit is to improve the ui of the project and task

So in this comit, project_id and tag_ids should be always visible
in fsm mode too. also re-sequence the task form view buttons and
added class for the proper xpath.

also move the common for for get_unusual_days on employee so it
can be reused.

Related enterprise PR: https://github.com/odoo/enterprise/pull/19134
Closes: #72440
TaskID: 2502339
2021-07-21 04:44:27 +00:00
William Braeckman a0fae57e5c [IMP] hr: department views
Moves a field from hr_holidays to hr (`total_employees` of hr.department)
to display it in the department list view.
Widen the department kanban view to display more information and allow
clicking on the department name in the kanban view to edit it.

Task ID: 2582448
2021-07-08 12:00:59 +00:00
William Braeckman d665098579 [IMP] hr,website_hr_recruitment: improve job views
Multiple improvement with job views:
 - Add a sequence field for jobs
 - Display 'Open Positions' on the website event if there is only 1 open
   position
 - Display whether the website is published on both the list and the
   form views of hr.job
 - Fix an issue introduced with 446d906f508880eb787debbec3c23cfd081bb045
   where html field would be cut and html tags would be displayed
Minor change:
 - Add an sql constraint on the estimated number of recruitment to be
   positive

Task ID: 2581595

closes odoo/odoo#72769

Related: odoo/enterprise#19264
Related: odoo/upgrade#2585
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-07-06 09:45:40 +00:00
Thibault Delavallée 76616dc888 [IMP] mail: improve default bounce message
Current bounce message is not very user friendly. Purpose of this commit
is to improve it, by improving wording and overall phrasing used in it.

Form view is improved so that bounce message takes all available width in
form view.

Some tests are added, notably to detect pseudo-void content from editor.

Task ID-2532529
PR odoo/odoo#71793

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-07 06:29:01 +00:00
Kevin Baptiste 9e6d2da504 [IMP] hr_attendance: compute overtime on attendances
This commit adds a new model `hr.attendance.overtime`.

When an employee checks out, an overtime entry will be created when:
    - the option is enabled on the company;
    - the employee worked more or less than the number of hours they
    were supposed to work that day.

TaskID: 1904850
2021-07-06 11:35:01 +02:00
William Braeckman bfa0a66e52 [IMP] hr: move personal documents to hr
Previously personal documents on employees were added with the belgian
contract salary module. This changes moves part of those fields to the
base hr module

Task ID: 2578139

closes odoo/odoo#72673

Related: odoo/enterprise#19219
Related: odoo/upgrade#2587
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-24 07:53:49 +00:00
Thibault Delavallée c47b0054b8 [FIX] mail, hr, test_mail: correctly Markup-ize bounce notification email content
It is currently escaped as it is not Markup-ed and not considered safe.
It means raw content is currently displayed in sent emails, which is not
really what we expect.

closes odoo/odoo#71911

X-original-commit: 62e6bc216aefe93c4cd1cca8e39f124a8a298386
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-09 11:43:11 +00:00
Krina Oza 962f13a2e0 [IMP] base,hr: imporve the language settings and access to it
Currently, in My Profile all the users have access to language settings
even when the user does not have the rights to activate/deactivate
languages. Also, the language setting list is not user friendly which
needs to be imporved.

so in this commit hide "More Languages" button in My Profile for users
that does not have the rights and the language settings list is
improved by adding seperate buttons to "activate", "disable" and "update" a
language.

PS: groups does not work on My profile so added the compute field based
on group.

closes odoo/odoo#69292

Taskid: 2466771
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-07 09:50:58 +00:00
dht-odoo 5ce7ad709c [IMP] hr: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) fleet.vehicle -> description
2) fleet.vehicle.log.contract -> notes
3) hr.job -> description
4) hr.contract -> note
5) hr.leave.allocation -> notes
6) hr.applicant -> description
7) lunch.product -> description
8) lunch.order -> product_description
9) lunch.product.report -> description

Task Id: 2499504

X-original-commit: afe52b050a7667f3f20696cd48cd922f635a941c
2021-06-07 05:24:08 +00:00
Aurélien (avd) 8c7e6d5dec [FIX] hr_employee: remove duplicates from working_hours computation
Since the computation of employees work intervals is done in batch,
i.e. 1 call to _work_intervals for each (tz, resource_calendar_id) pairs,
removing tz duplicates from mapped results improves
the perf of hr_presence_state/hr_icon_display computations.

This is especially true for grouped hr.employee kanban view as each column
search_read triggers a recompute for these fields.

closes odoo/odoo#71772

X-original-commit: be6d4a2523bb1a292908d09dfc5393bc0aa88a2d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-06-04 16:03:22 +00:00
William Braeckman 864595901e [IMP] hr,hr_payroll: plan automation on triggers
Automate activites linked to plan on certain triggers.
To automate onboarding and offboarding processes, we can now define
plans that will activate upon triggers, such as employee creation,
departure (archive), contract start or contract end.
Manual plans are still possible.

Upon activation of a plan, a message will be added to the employee's
chatter with the name of the plan.

More options have been added related to when to schedule the plan's
activities.

The blocking mechanism has been removed (the plan would not launch if an
activity could not be started, due to lack of information), failed
activities will now be logged into the employee's chatter.

The list and kanban employee views have also been updated to include
info such as first contract date and activity information.

Task ID: 2489095

closes odoo/odoo#68451

Related: odoo/enterprise#17343
Related: odoo/upgrade#2314
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-03 12:09:32 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
Yannick Tivisse f6a77867df [IMP] hr: Remove M2O references to archived employees
Purpose
=======

When you archive an employee, if he's the manager/coach of someone else, the link is not removed.

closes odoo/odoo#71368

Taskid: 2536219
Related: odoo/enterprise#18588
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-28 08:04:40 +00:00
sofiagvaladze 95daf9d28c [IMP] hr: Create activity a month before Work Permit Expiration Date
Add boolean field to upload work permit

Task - 2442648

closes odoo/odoo#65899

Related: odoo/upgrade#2173
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-24 21:40:32 +00:00
William Braeckman a5bcd6b1b9 [IMP] hr,hr_contract: hide fields according to country
Hide fields related to belgian localisation when not using a belgian
company.

Task Id: 2496597

closes odoo/odoo#69691

Related: odoo/enterprise#17881
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-19 07:28:31 +00:00
Raphael Collet 35a9f6c27a [FIX] core: SELF_READABLE_FIELDS and SELF_WRITEABLE_FIELDS on res.users
Avoid setting up those lists with method __init__() on the model, since
the model's class no longer has the expected parent classes.
2021-05-06 07:30:24 +00:00
Raphael Collet 34d6f87d54 [REF] core: put field.depends on registry and make field.recursive explicit
The attributes field.depends and field.depends_context are problematic
for sharing fields across registries, because they depend on the model's
registry class, which may vary from one registry to another.  In order
to make computed fields shareable, we have to move those values away
from fields.

For the same reason, field.recursive should not be inferred, because its
value may depend on the registry, although it is generally not the case.
Moreover, the flag recursive=True is set on a field when field triggers
are determined (on the registry).  A compute method may be called before
the flag is set (if no update has been done yet), and that can lead to
incorrect computations.

This happened in test TestUsers2.test_reified_groups in module 'base'.
The user groups view was apparently determined without the flag being
set, and the view depends on the recursive field 'trans_implied_ids',
which was not correctly computed.

We thus force developers to be explicit about recursive computed fields.
The code now logs a warning when the flag is not set up properly.
2021-05-03 12:33:29 +00:00
Xavier DubucandSébastien Theys e3ecccd641 [FIX] mail; hr: restore faster and more accurate mention suggestions
The code from v13 used to look for partners in JS before making the RPC, which
was much faster, and also gave better results by returning partners that were
already known and therefore more likely to be selected.

The same logic is reintroduced here, and further improved to take into account
all known partners and sort them according to the likeliness they will be
selected based on various criteria.

task-2413776

closes odoo/odoo#68045

X-original-commit: 930e090ced8134c3819a5a87b9052467ba23e8e4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2021-03-18 10:32:27 +00:00
Thibault Delavallée 62dc6a6173 [REF] mail, mass_mailing, hr, {(website_)im_/crm_}livechat: clean use of channel members in various code place
RATIONALE

Channel model is a mail.thread enabled model behaving strangely with followers,
notifications and discuss. Its code should however be simplified to be more
self contained and avoid unwanted side effects on other models.

SPECIFICATIONS

Purpose of this commit is to better differentiate channel members technical
model from partner members in code :

  * ``channel_partner_ids``: contacts member of a channel, filtering notably
    on active and checking ACLs on res.partner business model. This one
    should be used whenever we deal with members of a channel at business
    level;
  * ``channel_last_seen_partner_ids``: memberships of a channel and technical
    model. This one should be used for internal processes and members
    management;

Also containing

  * clean naming or API of methods managing channel members. This should
    not change anything functionally as only code renaming / cleaning is
    performed;
  * improve performances of channel member auto subscription by aggregating
    all members to add and creating them at once;
  * check the use of ``mail.channel.partner`` and ``res.partner`` records
    through ``channel_last_seen_partner_ids`` and ``channel_partner_ids``
    Channel fields;

Functionally nothing should change with this commit. It only cleans code
in order to prepare future modifications.

LINKS

Task ID-2070632 (main task)
Task ID-2419762 (followup task)
COM PR odoo/odoo#62859
ENT PR odoo/enterprise#15172
UPG PR odoo/upgrade#2005
2021-03-17 18:07:25 +00:00
Kevin Baptiste 5f98b6acdb [IMP] hr: add a model for departure reasons
The "Departure Reasons" where hardcoded and couldn't reflect all the
valid departure reasons (like "End Of Fixed-Term Contract").

This commit introduces a new model `hr.departure.reason`.

closes odoo/odoo#66905

Taskid: 2447056
Related: odoo/enterprise#16709
Related: odoo/upgrade#2211
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-10 08:32:36 +00:00
Yannick Tivisse 8bf4c194b7 [IMP] hr: Track job on employee form
closes odoo/odoo#66837

Related: odoo/enterprise#16678
Related: odoo/upgrade#2209
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-25 12:37:56 +00:00
Yannick Tivisse 1bd73558da [IMP] hr: Add work location number field
Could be useful, for example in the DMFA declaration

closes odoo/odoo#65792

Related: odoo/enterprise#16228
Related: odoo/upgrade#2159
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-16 08:44:43 +00:00
Fabrice Henrion 1b2087b6bd [IMP] hr: rephrase tooltip
closes odoo/odoo#55710

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-12 15:12:55 +00:00
Kevin Baptiste 3d5e912da7 [IMP] hr: add a model for work locations
The work location of an employee was previously a fields.Char. That was
changed to a Many2one field to a the new model called work.location.
That had some consequences in other modules that had to be slightly
adjusted.  The modules impacted were hr, hr_appraisal, hr_payroll.

Task id: 2335646

closes odoo/odoo#63192

Related: odoo/enterprise#15235
Related: odoo/upgrade#2020
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-05 13:00:09 +00:00
Laurent Stukkens (LTU) 7a516973d3 [IMP] hr_contract: add employee type
Prior to this commit:

* All employees were treated the same way regarding the contractual point of vue.

From this commit on:

* Three employee types will be created:
 - Employee, which is supposed to be under contract
 - Student & Contractor which are both not supposed to have an employee contract (but are still use the employee as working for the company)

* Employee view and Contract History will take this consideration into account.

closes odoo/odoo#64931

Taskid: 2446000
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-28 12:20:16 +00:00
Yannick Tivisse 5703ec3cd8 [IMP] hr: Make employee lang editable on employee + my profile
The field is defined on the private address (address_home_id) of the
employee.

It would be more convenient to allow the configuration directly on the
employee view and to allow the employee to change it by himself.

closes odoo/odoo#64949

Taskid: 2410407
Related: odoo/enterprise#15918
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-22 16:05:20 +00:00
sofiagvaladze d713b445c7 [IMP] hr: Hide menu_hr_employee for group_hr_user
Reason: In Employees app, it is confusing for the first time users to see
both 'Employees' and 'Employee Directory' folder. Also, first user
is not assigned to any departments.

Solution: If the user can see the folder 'Employees', don't show
the folder 'Employee Directory'. Assign the first user to the
'Administration' department.

Task - 2377506

closes odoo/odoo#63038

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-15 09:21:05 +00:00
Thibault Francois 9e487dc20e [FIX] hr: search on employee_id field raise bad query
Problem
-------
A user with no read access on private employee (hr.employee) model
will get a bad query error if he search on employee_id on res.users

The new domain evaluation system generate query like this
SELECT "hr_employee"."user_id" FROM "hr_employee_public"
because the _search of hr.employee was not returning the search result
from the right table

Solution
--------
Return a search result from the right table

closes odoo/odoo#63036

X-original-commit: e542c4121af098372c250a081635a44829e50406
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-08 14:52:50 +00:00
Yannick Tivisse 0078a21876 [IMP] resource: Remove deprecated methods 2020-12-08 10:22:36 +00:00
Yannick Tivisse 5b886a747a [FIX] hr: Edit private address fields directly instead of M2O
Purpose
=======

The goal of this commit if double:
- Prevent employees to change the m2o address_home_id, that could lead
  to future inconsistencies on future HR processes
- Allow the employee to modify it own private address, even if the
  access is restricted to administrators for private addresses

closes odoo/odoo#62891

Taskid: 2412387
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-04 13:38:51 +00:00