Commit Graph
532 Commits
Author SHA1 Message Date
Audric Onockx (auon) c64656266f [FIX] hr_holidays : allow user to submit past sick days
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

closes odoo/odoo#82311

X-original-commit: 9bc197fcf6c87678c82863706344e449b1cd69c1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Onockx Audric (auon) <auon@odoo.com>
2022-01-06 11:45:27 +00:00
Philippe Wauthy c0515b4585 [FIX] hr_holidays: fix being able to select invalid time off type
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

closes odoo/odoo#81724

X-original-commit: 20a2b29ee273c505f0279f128e8ac6c13c5be043
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-21 12:05:57 +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
Merlin (megu) ede7ae8e55 [FIX] hr_holidays: confirm allocation request with no validation needed
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

closes odoo/odoo#81143

X-original-commit: d985b96ba77f45edee8001d1063f644c99a15ffc
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2021-12-09 14:37:06 +00:00
Florian Damhaut 23b459abdf [FIX] hr_holidays : no traceback on accrual plan with no level
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

closes odoo/odoo#80849

X-original-commit: 0cf2ade4e6e959170906b4b0143e07909980b1d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-07 07:33:03 +00:00
Florian Damhaut 57451578c0 [FIX] hr_holidays : no traceback on accrual plan with non-supported language
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
2021-12-07 07:33:02 +00:00
Kevin Baptiste a790a241da [FIX] hr_holidays: fix wrong employee_id fallback
A wrong fallback value was used, the domain is expecting the employee ID
and not the employee record.

closes odoo/odoo#80663

Taskid: 2675380
X-original-commit: 6e68df1a69079bc16888ad588c97f234c9b9fa07
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-01 11:05:14 +00:00
Philippe Wauthy 3ae12a6f25 [IMP] hr_holidays: add default filters to smart buttons
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

closes odoo/odoo#79699

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-30 13:41:31 +00:00
sofiagvaladze 704ad908a1 [FIX] hr_holidays: restrict creation of allocations
Purpose: It does not make much sense to create allocations of such an
Time Off Types that don't require allocation.

task - 2658250

closes odoo/odoo#80541

X-original-commit: 69cee9c13b1d5267b74a9f107bae85ea1c42aa38
Related: odoo/enterprise#22589
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-29 16:28:05 +00:00
Philippe Wauthy b6ef46f71c [IMP] hr_holidays: show conflicting time off in validation error message
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

closes odoo/odoo#76452

Related: odoo/enterprise#22490
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-25 08:29:21 +00:00
Philippe Wauthy 5cdb8f51a3 [FIX] hr_holidays: fix time off with allocation of one day
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

closes odoo/odoo#80196

X-original-commit: 60f691bbac660d47404b35242303288880f084f7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-22 17:26:53 +00:00
Kevin Baptiste b90ee11ef3 [FIX] hr_holidays, *_calendar: disable sync on new leave
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.

closes odoo/odoo#80160

Taskid: 2693265
X-original-commit: 88884292e105eab2c36b2a334c617ac4978fa79c
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-22 11:56:46 +00:00
William Braeckman 8e049f4f26 [FIX] hr_holidays: fix allocation to time off link
The link between time off and allocation didn't check for allocation
state.

TaskId-2695066

closes odoo/odoo#80095

X-original-commit: d84d0b7a8bfbb88c538f4918dc7c226dc69ecc89
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2021-11-19 12:51:12 +00:00
Martin Trigaux 3887448aae [FIX] hr_holidays: translate the display_name of allocation
X-original-commit: 7e6f78896a0104087fa97f3ad8a0a46b92c91a0f
Part-of: odoo/odoo#79594
2021-11-10 07:45:53 +00:00
Philippe Wauthy 76ed106615 [FIX] hr_holidays: make holidays count consistent on employee form
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

closes odoo/odoo#78953

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-08 17:02:10 +00:00
Florian Damhaut e1566fa78f [FIX] hr_holidays : no traceback when validate -> refuse -> to draft leave
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

closes odoo/odoo#79503

X-original-commit: c4103536350ed6c0da93a18992e1f9b733bd845e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-08 13:24:29 +00:00
William Braeckman 25f6619378 [FIX] hr_holidays: fix being able to select invalid time off type
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

closes odoo/odoo#79498

X-original-commit: d5b36b5f73effc0344557a9d377468d4bb020695
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-08 13:24:14 +00:00
Tommy (tong) 3944e8903f [FIX] hr_holidays
- fix updating context cannot recompute _compute_leaves method

closes odoo/odoo#79485

X-original-commit: 4bacfb24158e4b32ba8419f0e984a4aea4b20b86
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-08 11:51:48 +00:00
Kevin Baptiste ba619ce027 [IMP] hr_holidays: allow users to cancel Time Off
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.

closes odoo/odoo#76722

Taskid: 2643713
Related: odoo/upgrade#2843
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-28 11:34:57 +00:00
William Braeckman 4a29ba94ad [IMP] hr_holidays_attendance: improve leave_type name_get
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
2021-10-26 14:10:56 +00:00
Kevin Baptiste 1e99b471f7 [IMP] hr_holidays: show all employees in list view
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.

closes odoo/odoo#78758

Taskid: 2674062
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 11:04:49 +00:00
William Braeckman 28fe74e051 [IMP] hr_holidays: stop listing portal users for time off manager
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

closes odoo/odoo#78605

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 11:04:45 +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 d52eebd6ca [IMP] hr_holidays: clean leave responsibles on user creation
New users automatically received the Leave Responsible role even though
they were not managing any employees.

closes odoo/odoo#78436

Taskid: 2635715
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-19 13:17:27 +00:00
William Braeckman 7529e4a15d [FIX] hr_holidays: fix displaying negative allocations
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

closes odoo/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>
2021-10-13 12:30:57 +00:00
Philippe Wauthy 6367ff2b33 [FIX] hr_holidays: Improve general UX (Back2basics)
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

closes odoo/odoo#77376

X-original-commit: 7f92c830d3607167bd76bc43d992fbf720a3ef29
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-29 08:33:26 +00:00
William Braeckman bd13371781 [FW][FIX] hr_holidays: Make accrual plan prorated
closes odoo/odoo#77342

Forward-port-of: #77311
Related: odoo/enterprise#21229
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-29 08:33:03 +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
William Braeckman 8f89c30998 [FIX] hr_holidays: fix wrong context for absent action
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

closes odoo/odoo#77157

X-original-commit: 9200742a1bde75ec2de02b9d11f67dc77538d79d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-24 12:35:43 +00:00
Samuel Degueldre 5c78793a75 [FIX] hr_holidays: fix crash in mail_partner_format
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.

closes odoo/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>
2021-09-23 07:17:52 +00:00
sofiagvaladze 2341087469 [IMP] hr_holidays: Validity date on dashboard
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

closes odoo/odoo#76257

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-20 16:39:54 +00:00
sofiagvaladze 42089cb78c [IMP] hr_holidays: Time Off dashboard information tag popover
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

closes odoo/odoo#76682

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-20 10:53:49 +00:00
Kevin Baptiste 4cc7211b8d [FIX] hr_holidays: accrual levels should be copied
The accrual levels were not copied when an Accrual Plan was duplicated.

closes odoo/odoo#76495

Taskid: 2639094
X-original-commit: bc62cc4033b6f065b09bf34b253eef3c4a3f289e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-14 13:32:28 +00:00
Kevin Baptiste 4cc00d44d6 [FIX] hr_holidays: correctly compute Time Off type statbuttons
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.

closes odoo/odoo#76468

Taskid: 2641596
X-original-commit: cc75a1233ed40cb1a4812a5f4a377b8859795b26
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-14 08:22:05 +00:00
William Braeckman fb3ac94ce8 [FIX] hr_holidays: count only valid allocations in dashboard
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

closes odoo/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>
2021-09-10 18:19:40 +00:00
Kevin Baptiste 8c969fb980 [IMP] hr_holidays: improve views
- 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

closes odoo/odoo#75940

Taskid: 2636417
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-08 12:44:49 +00:00
Julien Castiaux b8b89bf47d [FIX] core: prevent redundant default on related
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.

closes odoo/odoo#67762

Related: odoo/enterprise#17313
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-09-07 15:49:48 +00:00
William Braeckman 0a3bd7f414 [FIX] hr_holidays: fix action_with_unused_accruals visual
Fixes the above mentioned field in the hierarchical kanban view in the
accrual plan form view.

TaskId-2637152

closes odoo/odoo#75923

Related: odoo/upgrade#2802
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-03 14:30:43 +00:00
William Braeckman 32fd1fefc6 [FIX] hr_holidays: fix traceback on leave type smart button
Fixes a traceback when clicking the accrual smart button on the leave
type form view

TaskId-2637152

Part-of: odoo/odoo#75923
2021-09-03 14:30:42 +00:00
William Braeckman 36e3a2ab52 [FIX] hr_holidays: fix time off type/accrual plan selection
Previously when selecting one of those two fields the other would be
lost etc. it wasn't practical.

TaskId-2637152

Part-of: odoo/odoo#75923
2021-09-03 14:30:42 +00:00
William Braeckman 8109f6e701 [FIX] hr_holidays: fix is_officer not being computed
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
2021-09-03 14:30:42 +00:00
William Braeckman be6c49a921 [IMP] hr_holidays: improve accrual plan's code
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
2021-09-03 14:30:42 +00:00
254d6a71e8 [IMP] hr_holidays: Improve Accruals, dashboards and general UX (Back2basics)
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

closes odoo/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>
2021-09-02 12:57:03 +00:00
Audric Onockx (auon) 6cf8ff8ed7 [FIX] hr_holidays: Fix accrual dates based on creation date
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

closes odoo/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>
2021-08-18 09:08:14 +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
Sébastien Theys 7602c168d7 [ADD] test_discuss_full, *: add test for init messaging performance
* = 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
2021-08-12 15:21:42 +00:00
William Braeckman ddef148260 [FIX] hr_holidays: half day outside of working hours
Fixes taking a hald day outside of working hours counting as half a day
instead of nothing.

See odoo/odoo#68977

closes odoo/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>
2021-07-23 09:29:23 +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
Goffin Simon 261782d82e [FIX] hr_holidays: Rounding allocation_used_count and allocation_count
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

closes odoo/odoo#67849

X-original-commit: af8ce1d8891a4dcdeb80b069a114299d84e021f1
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-03-15 12:32:17 +00:00
Nicolas Lempereur c900e40868 [FIX] hr_holidays: request date tz whole company
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

closes odoo/odoo#73633

X-original-commit: eb5c4e9b8d32a10e460ac089794bf1ceb9b7b71a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-07-13 12:46:38 +00:00