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>
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>
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>
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>
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>
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>
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 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
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>
When the attendance app is installed and the extra hours option is
enabled, it could happend that we have an allocation with negative
virtual_remaining_leaves, however it does not make sense to display it
to the user.
This commit filters out that possibility from showing on the dashboard.
This commit also fixes a display mismatch between extra hours and other
time off types.
TaskId-2655689
closesodoo/odoo#78295
X-original-commit: c943b55237447ad58a994602e58702c952ac019d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
General fixes for usability
- Time off type configuration visual : https://tinyurl.com/yj2z6okp
- When you create an allocation, the end date should have a place holder "no limit". If there is no end date recorded, that value should be displayed on loading.
- In Overview, remove filter "people i manage"
- In Approvals / time off : change filters : https://i.imgur.com/uDNjZv8.png
- In Approvals / approvals : change filters like in point 5 (remove people I manage replace with my team)
- In Reporting / By Employee : filters : https://tinyurl.com/yg3u3rkf
- In Reporting / By Type : filters : https://tinyurl.com/yhbpgz5m
- Remove Allocations smartbutton from Employee App
- When you click on TimeOff Smartbutton from Employee App, you should be redirect to this screen : https://tinyurl.com/ygwxzx5b
- When an allocation is created, the validity is added to the name of the allocation like "Allocation X (validity Date --> Date) and hide the validity field in "My allocations".
- Users will have the information of the validity from the name of the allocation
task-2643692
closesodoo/odoo#77376
X-original-commit: 7f92c830d3607167bd76bc43d992fbf720a3ef29
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since odoo/odoo#35700 department_id is not a searchable field in the
employee search view as it has been added in the searchpanel. Since
then, the view from department > absence has been broken since it was
not filtering on the department anymore.
This commit fixes that behaviour by defaulting to the department in the
searchpanel instead.
TaskId-2648380
closesodoo/odoo#77157
X-original-commit: 9200742a1bde75ec2de02b9d11f67dc77538d79d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
We were trying to sort a list of date with potentially falsy elements in
the list, causing a crash while trying to compare a date object with a
bool. This commit just makes the check that all dates are not falsy
before attempting to sort.
closesodoo/odoo#77012
X-original-commit: 6bd2a86e37809b4d77aad4597e926e99f9d2b2ce
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
After this commit, in the Time Off dashboard, the user can see the validity
period of the available days in case if the related allocation
has a validity end.
If the time off has more than one allocation, we display the validity of the closest one.
task - 2636403
closesodoo/odoo#76257
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Purpose: From the dashboard, the user sees the number of left time offs,
but does not have an information regarding how it is calculated.
In this task, we add an information tag on the Time Off dashboard
next to each Time Off type that requires allocation.
When we hover over the tag, we see how is the number calculated.
For example, it could look the following way:
Allocated : 20 days
Approved: 5 days
Planned: 3 days
-----------------
Left: 12 days
task - 2643115
closesodoo/odoo#76682
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The accrual levels were not copied when an Accrual Plan was duplicated.
closesodoo/odoo#76495
Taskid: 2639094
X-original-commit: bc62cc4033b6f065b09bf34b253eef3c4a3f289e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The stat buttons were showing incorrect values, the accrual action was
not returning, archiving an employee was no longer possible because an
incorrect state was used.
closesodoo/odoo#76468
Taskid: 2641596
X-original-commit: cc75a1233ed40cb1a4812a5f4a377b8859795b26
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Since the recent time off B2B, time off validity has been moved from the
time off type to the time off allocation. Meaning that a company may use
the same time off type every year for their yearly time off.
This means that the dashboard must display currently valid data.
Remaining leaves and taken leaves will now be computed in function of
that data aswell in the dashboard.
This commit also fixes being able to take a leave if the current
allocation does not permit it if an expired one would have made it
possible.
TaskId-2636405
closesodoo/odoo#76366
X-original-commit: eeccd682124fe83d2c2342be0d8804aa2ca21146
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
- Hide transition mode if there is 0 or 1 level on accrual plan;
- Fix kanban card
- Reduce bottom padding on calendar view
- Log a message when an allocation linked to accrual runs for the first
time
closesodoo/odoo#75940
Taskid: 2636417
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Setting a default value on a readonly related field without an inverse
method is nonsense. We log some warning when it happens.
We also fixed other cases where a related field has a default value
that overrides the target field's value.
closesodoo/odoo#67762
Related: odoo/enterprise#17313
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Fixes the above mentioned field in the hierarchical kanban view in the
accrual plan form view.
TaskId-2637152
closesodoo/odoo#75923
Related: odoo/upgrade#2802
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Field `is_officer` is required for some of the elements in the from view
to be readonly or not.
However it would not be computed before record creation which would
cause issues.
This is now fixed by adding something to trigger the compute even though
it is not used.
TaskId-2637152
Part-of: odoo/odoo#75923
Minor code cleanup; remove dead code; update comments.
Also fixes a bug on the first time the accrual plan is called.
TaskId-2637152
Part-of: odoo/odoo#75923
Purpose
=======
Time Off : New Dashboard, Accruals feature, Public holidays, New time off type configuration view.
- Review of Dashboard
- Accrual feature : Currently, when you create an allocation, it's possible to create an
Accrual, but there is no appraisal Plan. An Appraisal plan is use to define steps of accruals
for each employee.
In Belgium, we use accrual Allocation for European Leaves, or compensatory hours, it's a
simple use case. But in USA, it's possible to change the calculation mode each year.
Also, in USA, it's possible to deal your accrual plan when you arrive on the company. It's a
HR Officer task to create the right Accrual allocation for each new employee.
- Public Holidays :
Improvement of global time off feature located on Working hours calendar. Now, Time off
application have to manage Public Holidays.
- Review of Time Off type configuration
COM PR: https://github.com/odoo/odoo/pull/72511
ENT PR: https://github.com/odoo/enterprise/pull/19157
UPG PR: https://github.com/odoo/upgrade/pull/2791
TaskID:2475413
closesodoo/odoo#72511
Related: odoo/enterprise#19157
Related: odoo/upgrade#2791
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
Steps:
1. Create new time off allocation
2. Set type to accrual and set start date other than present day
3. Set the accrual to add every month
4. Validate and run the scheduled action for Accrual Time Off
5. Check the field 'nextcall' with Studio or editing form view
Result:
Nextcall date is set to 1 month after the date of creation of allocation record instead of start date.
Solution:
Nextcall is now based on start date.
opw-2558480
closesodoo/odoo#75234
X-original-commit: 3f7f0feb31d80c5cb3364c3a7d530c80b6278b40
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Signed-off-by: Audric Onockx <auon-odoo@users.noreply.github.com>
* = 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
closesodoo/odoo#73174
Related: odoo/enterprise#20186
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = hr_holidays
This new module will contain more tests as time goes on.
This new test will serve as indicator for future performance improvements.
Fix missing `flush` before query in `hr_holidays`.
Part of task-2622462
Fixes taking a hald day outside of working hours counting as half a day
instead of nothing.
See odoo/odoo#68977closesodoo/odoo#74147
X-original-commit: 35a7308188d069465ad624d4199ec26b6d25d651
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
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/19134Closes: #72440
TaskID: 2502339
Steps to reproduce the bug:
- Let's consider an employee E with 8.00 hours as Average Hour per Day
- Create an Allocation for E with a Time-off Type in Hours
(be sure the number of hours is different from the average hour per Day)
- Open the form view of E
Bug:
The smart button Time Off(remaining leaves) was completely unreadable
opw:2441019
closesodoo/odoo#67849
X-original-commit: af8ce1d8891a4dcdeb80b069a114299d84e021f1
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When setting the request_date_from and request_date_to when creating a
leave that will be used to show the range of days of the leaves, we are
using the current user timezone to determine it.
eg. in UTC+2 if the leave begins at midnight on the 6th, we will see 6
and not 5 which is the day in UTC.
When creating a leave in a mode different than employee, when it is
confirmed and a leave is created for each employee, we would use the UTC
day instead which is a little unexpected.
Without the fix, the added test fails with:
AssertionError: datetime.date(2019, 5, 5) !=
datetime.date(2019, 5, 6) : Timezone should be kept between company
and employee leave
opw-2573730
closesodoo/odoo#73633
X-original-commit: eb5c4e9b8d32a10e460ac089794bf1ceb9b7b71a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>