Commit Graph
3220 Commits
Author SHA1 Message Date
Rob Coekaerts e4ac144ace [IMP] hr_holidays: 'My Department' filter now includes child departments.
The "My department" filter in the "Time Off" overview menu is changed to also include the leaves of employees from child departments (all the way to the bottom of the hierarchy).

task-2699541

closes odoo/odoo#81597

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-01-07 07:26:53 +00:00
Kevin Baptiste 7bde79a367 [IMP] hr: add populate script
Add a populate script to automatically create lots of
employees/jobs/tags/work locations/departments.

closes odoo/odoo#82259

Taskid: 2728608
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-01-05 16:21:55 +00:00
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
William Braeckman 60ee56c0ed [REV] hr: revert commit 0e12620
Reverts commit 0e126201bf801e20412ae2b4cdf07e4a600adbd1
from PR #79472

TaskId-2715341

X-original-commit: bf1b27f9a77b42cd969a5129f67b9ffb0feed656
Part-of: odoo/odoo#81612
2021-12-17 16:58:09 +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
Alexandre Kühn b2d2b78fbc [IMP] mail: rename user model
Rename javascript model mail.user to User in order to distinguish
javascript models from python models.

Task-2701674

closes odoo/odoo#81471

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-15 15:50:44 +00:00
Louis Wicket (wil) db0afd3760 [IMP] mail, *: rename partner model
Rename javascript model `mail.partner` to `Partner` in order to
distinguish javascript models from python models.

Part of task-2701674.
 * = hr, hr_holidays, im_livechat, website_livechat

closes odoo/odoo#81406

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 11:12:47 +00:00
Louis Wicket (wil) 5ce76d3af8 [IMP] hr: rename employee model
Rename javascript model 'hr.employee' to 'Employee' in order to
distinguish javascript model from python model.

Part of task-2701674.

closes odoo/odoo#80561

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 11:11:51 +00:00
Louis Wicket (wil) a43d662017 [IMP] mail, *: rename thread model
Rename javascript model `mail.thread` to `Thread` in order to
distinguish javascript models from python models.

Part of task-2701674.
 * = hr, hr_holidays, im_livechat, website_livechat

closes odoo/odoo#81433

Related: odoo/enterprise#22910
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 01:59:16 +00:00
Louis Wicket (wil) deb12bc032 [IMP] hr, mail, snailmail: rename messaging model
Rename javascript model `mail.messaging` to `Messaging` in order to
distinguish javascript models from python models.

Part of task-2701674.

closes odoo/odoo#81386

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 00:10:48 +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
Miquel Raïch 70ae1cf628 [FIX] hr: avoid <footer> not found error in view
closes odoo/odoo#80554

X-original-commit: fc5ae487fc178d43c487271d174e27d060b56d1d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 11:17:15 +00:00
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +00:00
Philippe Wauthy 1db8dc26c7 [FIX] hr: update accesss right for hr_employee
In a multi-company environment, it is not possible to update information (language, email,...) from My Profile.
The security rule only allows to change information if the right company is selected or if the user has no company.
Since a user assigned to several companies will have several records in hr_employee referring the same user_id, the security rule is now updated to allow updating information from the My Profile page if the hr_employee.user_id refers to the current user_id.

task-2678411

closes odoo/odoo#80637

X-original-commit: 3e9393c71ccf1b00c051155afd68b3a0cfff05cd
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-30 17:40:04 +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
Kartik Chavda 17e58758de [IMP] sale,sale_(project,timesheet): improve the UI
Purpose of the commit is to do the generic improvement for the
project:

So in this commit, done the following changes:
- duplicating a project, copy all milestone of project and
set is_reached and deadline field as 'False'.
- chanage the order of the state button in sale order form view.
- pass mail body as default description value in message_new
method of project task.

task-2652943

closes odoo/odoo#77065

Related: odoo/enterprise#21199
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-26 13:37:58 +00:00
Louis Wicket (wil) 2cb3f774a1 [IMP] mail,*: change model declaration syntax
* = calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot, sms,
     snailmail, website_livechat

This commit will change the declaration of the models with the aim of
getting closer to a plain JSON-object. It allows us to eliminate a wide
portion of boilerplate code, making the declaration shorter, more
declarative, and less redundant, but mainly, it prepares the ground for
further changes.

Task-2695223

closes odoo/odoo#79259

Related: odoo/enterprise#22042
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-23 17:53:46 +00: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 28eba3d6db [IMP] hr_skills: improve UX
- Reset skill levels on skill/skill type change
- Improve form view
- Add a sequence on hr.skill

closes odoo/odoo#73305

Taskid: 2575351
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-18 10:53:59 +00:00
Leonardo Pavan Rocha 351056ec5d [IMP] base,hr: add tests for avatar mixin
In task 2404630 the avatar feature was created and no tests were written due to
the iminent freeze. This PR implements tests for the avatar feature, such as
avatar generation and placeholder logic.

task-2578233

closes odoo/odoo#79688

X-original-commit: 400b3fd93266f88832446c8f7422f6e14b958115
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-12 12:00:23 +00:00
William Braeckman ecddd5f729 [IMP] hr_*: Improve tests execution speed by using setUpClass
closes odoo/odoo#79063

Taskid: 2669222
Related: odoo/enterprise#21920
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-27 13:16:42 +00:00
Kevin Baptiste 497c2b9ab8 [IMP] hr: show employees on Department form
Show an "Employee" stat button on the department form view.

closes odoo/odoo#78680

Taskid: 2672986
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-21 15:47:10 +00:00
William Braeckman c4621c4099 [IMP] hr: update hr plans wording
To avoid mixing both plan and planning in hr plan options it was decided
to reword menus to plan instead of planning.

TaskId-2664863

Part-of: odoo/odoo#78148
2021-10-21 11:08:54 +00:00
Kevin Baptiste 60d62a1d9d [REF] hr*: misc cleanup
*: hr_expense, hr_holidays, hr_work_entry_holidays

- Remove unused template;
- Remove unused fields (hr_expense);
- Rename group_days_allocation to convey proper meaning;
- Remove deprecated method.

closes odoo/odoo#78128

Related: odoo/upgrade#2907
Taskid: 2665866
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-20 15:15:03 +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
Sébastien Theys 3a87aaf914 [IMP] mail, *: clean up message component by introducing view model
* = hr, hr_holidays, sms, snailmail, website_livechat

Message model incorrectly contained data related to a specific component (only
one) even though there can be multiple message components per message model.

This cascaded to adapting related component/models to the same principle.

closes odoo/odoo#76718

closes odoo/odoo#77779

Related: odoo/enterprise#20964
Related: odoo/enterprise#21426
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:40:49 +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
Swapnesh Shah b948b197da [IMP] hr: Make timezone required on saved record
`tz` field is technical field related to `resource_id`, which is required field on that model.

However it is possible to try to write a void value, which leads to an issue as it is technically required.
With this commit we make the tz field required at write.

closes odoo/odoo#77372

X-original-commit: 7cda3632b1f50ea757d25369e8a1261d8aeab16d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-29 08:33:22 +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
Sébastien Geelen (sge) e3a0a62622 [FIX] note, project, hr: collaboration opt-in on html fields
Activate the new opt-in option for the collaboration
on some html fields.

closes odoo/odoo#77160

X-original-commit: 504bbafc1d6183e7e8e0a326d1e90eddce6410d7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-24 14:00:45 +00:00
Kevin Baptiste 2012a9d205 [FIX] hr: bring back "My Profile"
Since the merge of 0573aca the override was no longer working.

closes odoo/odoo#77097

Taskid: 2651838
X-original-commit: 947194644a09f186899f2b2526cf0b0675af7304
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-24 05:50:48 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Louis Wicket (wil) 80d74e7ee0 [IMP] mail, web, *: add support for guest users
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
    snailmail, survey, test_discuss_full, test_mail, web_editor, website,
    website_livechat

 - Create new model `mail.guest` for guests.
 - Rewrite some RPCs to target routes rather than model methods so that
   guests are able to use them.
 - Patch JS and python models to support guests.
 - Create a stand-alone page and boot the channel in it.

task-2494829

closes odoo/odoo#75496

Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-02 00:43:34 +00:00
William Braeckman a3980aec99 [IMP] hr: remove personal documents tab
The personal documents tab on the employee form view is removed in favor
of the chatter + documents app to hold and manage documents.
The fields are kept because the salary configurator needs fields to bind
to be able to still request documents. This might change in the future.

Closes odoo/odoo#75506

Task ID: 2628750

Related: odoo/enterprise#20420
Related: odoo/upgrade#2769
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 23:35:21 +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
William Braeckman d88ea4011b [IMP] hr: use employee tags more
Adds the employee tags as an optional field in the employee list view
as well as in the search view.

Closes: odoo/odoo#75480

Task ID: 2630604

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-27 12:16:00 +00:00
Romain Derie 88b19cfa92 [FIX] base, mail: _render_qweb_pdf should return a bytes-like object
`result` might be a Markup object (eg during tests) or a bytes-like object.

Step to reproduce: click on "Send by Mail" on a SO -> Traceback

Step to reproduce (2):
- Install website_sale
- Add something to the cart
- Go through checkout and click on Pay Now
- Crash, 500 error page, as this step is trying to generate the SO PDF to send
  by mail to the customer, which tries to encode a bytes-like object.

```
AttributeError: 'bytes' object has no attribute 'encode'
```

But if you do that flow during a test, eg
```
./odoo-bin -d mydb --test-tags=.test_02_admin_checkout
```
You have a Markup object, thus you had to encode it.

Now, even during test, we return a bytes-like object.

Related to #68299

Community: https://github.com/odoo/odoo/pull/75377
Enterprise: https://github.com/odoo/enterprise/pull/20449
Part-of: odoo/odoo#75377
2021-08-26 10:21:28 +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
Zelong Lin 51ff8b09db [REF] *: convert JS files to ES6 modules
* = hr, hr_holidays, sms, snailmail, website_livechat, account_invoice_extract,
approvals, documents, mail_enterprise, calendar, crm, mrp, note, website_slides,
crm_enterprise, sign, social, voip

task-2510656

closes odoo/odoo#72712

Related: odoo/enterprise#19241
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 14:31:55 +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 41445f2ae6 [IMP] mail, hr: access messaging without env in remaining places
Part of task-2582313
2021-08-19 13:55:28 +00:00
Sébastien Theys 1a98248155 [IMP] mail, *: access models without env in models
* = hr, im_livechat, website_livechat

Part of task-2582313
2021-08-19 13:34:59 +00:00