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
closesodoo/odoo#81597
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps:
- Users > Admin > Acces Rights > Human Resources
- Time Off : empty
- Time Off > a past day > Time Off Request wizard :
- Time Off Type : Sick Time Off
- Confirm
Issue:
- User Error : 'You must have manager rights to modify/validate a time off that already begun'
Cause:
- When creating the request, attachments are writen onto the record.
- Yet the user do not have rights to write in hr_holidays.
Fix:
- sudo in the compute and inverse methods that write the attachments.
opw-2714597
closesodoo/odoo#82311
X-original-commit: 9bc197fcf6c87678c82863706344e449b1cd69c1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Onockx Audric (auon) <auon@odoo.com>
'New Time Off' and 'Allocation Request' dialogs were not translated to the user's language
Steps to reproduce:
1. Install the Time Off app
2. Go to General Settings, add a language and switch to it
3. Open the Time Off app and click on the button 'New Time Off' (which is now translated to the language you chose)
4. The field names of the dialog that opens are not translated
Solution:
Add the user's language to the context of the dialogs
OPW-2715396
closesodoo/odoo#82246
X-original-commit: bb4c568fe6cc32e7a0a26960276999113b858144
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
test_leave_whole_company_07 test was failing due ot the hr_leave_date_check2
constraint.
This constraint check that date_from <= date_to for a leave.
date_from and date_to were not assigned any value before and had a default value
of fields.Datetime.now. Depending on which date_from or date_to is created first,
a few second difference can exist and this violates the hr_leave_date_check2 constraint
task-2726143
closesodoo/odoo#82192
X-original-commit: c51553405b727e0187c0cf27b0ef9e0cb6023056
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In test_limited_type_days_left, a time off was created with:
- 'date_from': (datetime.today() - relativedelta(days=2)),
- 'date_to': datetime.today(),
The test fails beginning of January as the allocation created at the
beginning of the test is valid between Jan 1 and Dec 31
task-2726171
closesodoo/odoo#82179
X-original-commit: df71862e59943b83584c36b08acd9700998716e1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In test_01_leave_request_flow_limited, a time off was created with:
- 'date_from': (datetime.today() + relativedelta(days=2)),
- 'date_to': datetime.today() + relativedelta(days=3),
The test fails during the end of December because no allocation is found.
The time is now frozen in the test
task-2726308
closesodoo/odoo#82178
X-original-commit: 1d6e736832b56a4c2bf1b9e335ed2bd8f929507a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Fixes an error happening near the end of the year with one of the test.
The error was introduced with 254d6a71e8
TaskId-2724172
closesodoo/odoo#82028
X-original-commit: 1de3a4bee7b1df4960694d0851e72ef2eecb98a9
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Prior to this commit, the _search_valid method returns all the time off types.
With this commit, only the time off types that have a valid allocation are returned
task-2711388
closesodoo/odoo#81724
X-original-commit: 20a2b29ee273c505f0279f128e8ac6c13c5be043
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The test `test_unused_accrual_postponed` was expecting at least 25
holidays to be accrued, but started failing around mid-December.
closesodoo/odoo#81592
X-original-commit: c2865b7f5b654a61d4b2690133797aa39712b00d
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
When Freezegun is used with the `start` and `stop` method and the test
fails before the `stop`, the time stays frozen for all the other tests.
When it happens on runbot, a lot of tests brake with a lot of noise as
they are false negatives.
X-original-commit: 048796dc125b0d494f3c2fcd12625a84ee5cd91d
Part-of: odoo/odoo#81592
Rename javascript model `mail.thread_viewer` to `ThreadViewer` in order
to distinguish javascript models from python models.
Part of task-2701674.
closesodoo/odoo#81437
Related: odoo/enterprise#22911
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#81406
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#81433
Related: odoo/enterprise#22910
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
An employee could not confirm an allocation request of a type that doesn't need validation
Steps to reproduce:
1. Connect as admin
2. Install and open the Time Off app
3. Create a time off type in Configuration->Time Off Types with
- Requires allocation: Yes
- Approval: No validation needed
4. Connect as demo
5. Open the Time Off app and create an allocation request of the type created just before
Solution:
Add a condition before raising the error that checks the allocation validation type
OPW-2683477
closesodoo/odoo#81143
X-original-commit: d985b96ba77f45edee8001d1063f644c99a15ffc
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
How to reproduce :
-Create accrual plan with no level
Current Behaviour :
Traceback because num2words does not support all of odoo language
For supported language, the numbers showed are not ordinal
Behaviour After PR:
Show Basic numbers in every case
opw-2697987
closesodoo/odoo#80849
X-original-commit: 0cf2ade4e6e959170906b4b0143e07909980b1d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
How to reproduce :
-Set language to portugese
-Try to access accrual plan in time off
Current Behaviour :
Traceback because num2words does not support all of odoo language
For supported language, the numbers showed are not ordinal
Behaviour After PR:
Show Basic numbers in every case
opw-2697987
X-original-commit: afa531b6c8a06f553784e90df7641024d9bb142c
Part-of: odoo/odoo#80849
A wrong fallback value was used, the domain is expecting the employee ID
and not the employee record.
closesodoo/odoo#80663
Taskid: 2675380
X-original-commit: 6e68df1a69079bc16888ad588c97f234c9b9fa07
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Add default filters to the Allocations and Time Off smartbuttons on the time off type form.
This is done to avoid having numerous records with time and only show the relevant to approved and approved allocations as well as the time off for the current year.
task-2688122
closesodoo/odoo#79699
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Currently, in the overview page of timeoff, in gantt view all
records of the company are displayed. The purpose of this commit
is to improve the loading time by displaying less information
also remove "by employee and time off type" from reporting.
So in this commit, added a default filter "My Department" on
overview page and removed "by employee and time off type" from
the menu "reporting".
closesodoo/odoo#80542
Task-id: 2695774
X-original-commit: ede8331294ebd163af93c8c02eacfbffccfa97c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Purpose: It does not make much sense to create allocations of such an
Time Off Types that don't require allocation.
task - 2658250
closesodoo/odoo#80541
X-original-commit: 69cee9c13b1d5267b74a9f107bae85ea1c42aa38
Related: odoo/enterprise#22589
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The number of leaves taken / available was no longer available
in mobile.
closesodoo/odoo#80513
Taskid: 2701070
X-original-commit: 3c68b1cad227235a915b4908b6d73aee030e54bc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/odoo#77065
Related: odoo/enterprise#21199
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Description of the issue/feature this PR addresses:
In hr_holidays, there is no information about the conflicting time off when a second time off is scheduled at the same time.
There is a validation error saying "You can not set 2 time off that overlaps on the same day for the same employee".
The validation error should display the conflicting time off
Current behavior before PR:
The validation error displays the following:
"You can not set 2 time off that overlaps on the same day for the same employee"
Desired behavior after PR is merged:
The validation error will display the following:
"You can not set 2 time off that overlaps on the same day for the same employee.
Existing time off: Mitchell Admin / Trip with Family : 24.00 hours / from 06/09/2021 to 08/09/2021 / To Approve"
task-2641682
closesodoo/odoo#76452
Related: odoo/enterprise#22490
Signed-off-by: Kevin Baptiste <kba@odoo.com>
* = 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
closesodoo/odoo#79259
Related: odoo/enterprise#22042
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, picking a range of dates by clicking on
the end date field set the wrong date on the start date field.
This was because the option "related_end_date" was used
on the end date field instead of "related_start_date"
Replacing the "related_end_date" by "related_start_date"
on the end date field fixes the issue.
closesodoo/odoo#79997
X-original-commit: 8402e55e0db474ee64e641866d8c76302fb1ef4e
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
As an HR officer, when you create an allocation of one day for a user,
you need to be able to put a time off on that person, following the allocation.
But for the moment, we got an error saying there is no valid allocation on that day.
If you create an allocation of 1 day, you need to be able to put a time off on
that specific day without any error message.
task-2696771
closesodoo/odoo#80196
X-original-commit: 60f691bbac660d47404b35242303288880f084f7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
- Use fully qualified column names to avoid ambiguities.
- Remove the useless usage of `row_number()`. The ID of the timeoff can
act as ID. It also allow the removal of the `ORDER BY` clause which
accelerate the query execution
- Correctly compute the timezone. Gettting the timezone of the current
user at build time led to invalid data.
closesodoo/odoo#80172
X-original-commit: fed5b8e4ebafd4002d66d1c748ea4e2b2f650f21
Signed-off-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: Christophe Simonis <chs@odoo.com>
On large databases, the `postcommit` hook for Google|Microsoft Calendar
was taking up to 10% of a leave validation even if the user has the sync
disabled.
This commit disables the postcommit hook for new leaves, as the event will
be synced through the cron eventually.
closesodoo/odoo#80160
Taskid: 2693265
X-original-commit: 88884292e105eab2c36b2a334c617ac4978fa79c
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The link between time off and allocation didn't check for allocation
state.
TaskId-2695066
closesodoo/odoo#80095
X-original-commit: d84d0b7a8bfbb88c538f4918dc7c226dc69ecc89
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
The domain on the allocation leave type was too restrictive for Time Off
Officer and they couldn't create allocations when the "Employee
Requests" of the Time Off Type was set to "no".
This commit allows the Time Off Officer to request those allocations
again.
closesodoo/odoo#80041
Taskid: 2694163
X-original-commit: d79af924a59f32a0b2dee9b10bb7c8cf388892df
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Current Behaviour :
Employee can request any type of leave.
Behaviour after the PR:
Employee are only shown leave that they can request.
opw-2684670
closesodoo/odoo#79502
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The holidays count on the employee form is not consistent with the count on the dahboard.
The count on the employee form counts the holidays left based on the approved holiday.
The count on the time off dashboard counts all the holidays that are not cancelled or refused.
The time off counts should be consistent across the different screens.
Task-2670658
closesodoo/odoo#78953
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Current Behaviour :
Go to Time off -> Approvals -> Time Off -> create one time off of type 'Annual Time Off 2021' for multiple employees (i.e. Anita, Abigail and Audrey) -> validate -> refuse -> set to draft -> Traceback
Behaviour after the PR :
No traceback
opw-26842777
closesodoo/odoo#79503
X-original-commit: c4103536350ed6c0da93a18992e1f9b733bd845e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Before to this commit all time off type would be displayed if ANY
allocation of that type existed for the time period selected, however
logically we only want to display them if the user selected/current user
has a valid allocation. This caused some issues with the extra hours
time off type.
TaskId-2658077
closesodoo/odoo#79498
X-original-commit: d5b36b5f73effc0344557a9d377468d4bb020695
Signed-off-by: Kevin Baptiste <kba@odoo.com>
A user without Time Off rights is now allowed to cancel their own
validated time off when:
- It's not yet started;
- No work-entries has been generated for it yet.
The time off is archived and the days taken reallocated.
closesodoo/odoo#76722
Taskid: 2643713
Related: odoo/upgrade#2843
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The name_get for leaves types would previously not show the number of
hours available to the user for the extra hours time off type.
This commit adds that special case of time off type.
This commit also improves the leave_type name_get overall, by allowing
the hours to be display upon initial loading when requesting new
leaves/allocations properly.
Thanks to this change we do not need to display the number of extra
hours available at all time in the form views.
TaskId-2655689
Part-of: odoo/odoo#77841
Improves on _attendance_intervals_batch to profit more from batching.
Resources are grouped by timezone since we know they will all have the
same result except for when there are resource assigned attendances.
Those have to be handled separately but are incoroporated in the same
routine.
TaskId-2674527
closesodoo/odoo#78741
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
A time off for multiple employees was not showing who the employees were
in the list view.
Now it shows the avatar of all employees in the list view.
closesodoo/odoo#78758
Taskid: 2674062
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Removes the ability to select a portal user as time off manager for an
employee.
This also adds a domain to restrict the time off manager on users that
have access to the employee's company.
TaskId-2671420
closesodoo/odoo#78605
Signed-off-by: Kevin Baptiste <kba@odoo.com>
New users automatically received the Leave Responsible role even though
they were not managing any employees.
closesodoo/odoo#78436
Taskid: 2635715
Signed-off-by: Kevin Baptiste <kba@odoo.com>