Commit Graph
621 Commits
Author SHA1 Message Date
Swapnesh Shah 97ec1f4ab3 [FIX] hr_holidays: correct date format on leave name
Before this Commit, dates was not formatted based on user's language.

With this commit, we use format_date to correctly format dates.

closes odoo/odoo#108442

X-original-commit: 4da7129695f2619711f08ed7c36a37543deaa31d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-22 10:39:28 +01:00
Kevin Baptiste 5989755252 [FIX] hr_holidays: only show stress days of logged companies
Only show the stress-days of the enabled companies.

task-3098721

closes odoo/odoo#108277

X-original-commit: 7fb96b24fd8ec65b58c43d223dc63c0068b6269a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-19 13:38:12 +01:00
niyasraphy 999043b36c [IMP] *: change leave string's to time off
update various string/labels contains "Leave" in hr_holidays, hr_work_entry_contract, resource, test_resource and project_timesheet_holidays modules to "Time Off"

closes odoo/odoo#107504

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-09 16:40:58 +01:00
MerlinGuillaume 92424f5710 [FIX] hr_leave: validate leave in multi-company environment
Validating an employee's leave with multiple companies selected doesn't
work when the employee isn't part of one of the selected companies

Steps to reproduce:
1. Install Time Off
2. Go to General Settings > Companies and create another company
3. Connect as Marc Demo, open Time Off and create a new time off request
4. Connect as Mitchell Admin and go to Time Off > Managers > Time Off
5. Approve and validate the time off request of Marc Demo
6. An access error is raised: `Access to unauthorized or invalid
   companies.`

Solution:
Clear `allowed_company_ids` from the context when we create the
`calendar.event` to avoid raising the error

Problem:
The creation of the `calendar.event` didn't use the correct user's
`allowed_company_ids` in the context

opw-3052973

closes odoo/odoo#107415

X-original-commit: a5ab773378f5ba2241793c536cf141d27d250ae5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-12-07 19:56:23 +01:00
Joren Van OnderandFabrice Henrion 6202c296d8 [IMP] hr_holidays: better transition_mode tooltip
The previous tooltip was a bit confusing, replace it with a better
one.

closes odoo/odoo#107170

Signed-off-by: Kevin Baptiste <kba@odoo.com>
Co-authored-by: Fabrice Henrion <fhe@odoo.com>
2022-12-06 10:52:34 +01:00
sofiagvaladze bfa7a47c86 [IMP] hr_holidays: hinder allocation date_to to precede date_from
Purpose: In order to reduce the possibility to make errors, make the end
date of the validity period always come after the start date.

task - 3069666

closes odoo/odoo#106966

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-02 14:40:28 +01:00
Philippe Wauthy d61af003e1 [FIX] hr_holidays: fix allocation without validation
In hr_holidays, when the time off type has the following settings:
- Requires allocation: Yes
- Employee Requests: Not allowed
An allocation created with this time off type still requires to be validated.

This commit removes the need to validate an allocation created with the time off type described above.

task-3004313

closes odoo/odoo#106337

X-original-commit: c98e1280aee2f31e6dbf3f52dac47cf020c628d2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-23 17:14:54 +01:00
Dossogne Bertrand 5c4e180960 [FIX] hr_holidays: fix default leave display_name
Before this commit, creating a new leave as an officer
from the approval tab would have by default no time off type,
resulting in "Employee on False" in the display_name.
After this commit, the display_name will set "on Time Off"
instead of "on False" when there is no Time Off Type set.

task-3054318

closes odoo/odoo#104963

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-21 11:49:57 +01:00
Rob Coekaerts d66569498a [FIX] hr_holidays: fix time-off type multi-company
At this time, the responsible for a time off type can be a user related
to another company. With this commit, this is no longer possible.

In order to do this (and to fix the existing bug that the domain on the
responsible_id field was overwritten by the domain specified on the
form view), the domain on the form view was moved to the responsible_id
field itself.

task-2981972

closes odoo/odoo#100381

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-26 12:23:03 +02:00
Philippe Wauthy 572027ab47 [IMP] hr_holidays: improve Time Off report colors
When printing the Time Off pdf report for Time Off summary from the employee form, the colors
of the Time Off are not related to the Time Off type but are defined as red by default and assigned
another color in the demo data.

This commit maps the colors of the Time Off Type to the colors available in the Chart.js library

task-2963752

closes odoo/odoo#99804

Related: odoo/enterprise#31154
Related: odoo/upgrade#3894
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-24 10:54:15 +02:00
sofiagvaladze 470674ead4 [FIX] hr_holidays: correct the dashboard validity date
Prior to this fix, closest_allocation_to_expire was the upcoming allocation regardless
whether there were remaining leaves on it or not.

That lead to misleading information on the dashboard.
For example, let's say user has two allocations and used up the first allocation
and has X days left on the second allocation. Still, the user will see that they have
left X days (Valid until -- the first allocation expiration date --). Which is misleading,
Instead they should see X days (Valid until -- the second allocation expiration date --).

task - 2978789

closes odoo/odoo#103813

X-original-commit: dee3552659bec78fbbce4e8af155b3259e721dbd
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-21 18:10:54 +02:00
Dossogne Bertrand 774ca9da1a [FIX] hr_holidays: fix multiple-employee leave
Before this commit, creating a leave for multiple employees
from the manager's page allowed to create leaves regardless
of the concerned employee's allocations.
After this commit, an error message will be displayed to inform
which employee cannot take that leave.

Also removes unused imports.

task-2995120

closes odoo/odoo#103733

X-original-commit: 636a8276e6797c1d8fe43da61d2fd26b558bfa45
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-21 12:06:04 +02:00
Yannick Tivisse f312fb02ef [FIX] hr_holidays: Allow creating time off in the past
Purpose
=======

In the case a time off is created:
- In the past
- Using support documents

An invalid user error is raised in the interface, because the webclient
is sending values for the field 'supported_attachment_ids' (Example: [(6, 0, [])])
which is writing by inverse relationship on the field 'attachment_ids'.

On the other hand, it should be possible for an employee to add attachment
on the time off after it has begun.

closes odoo/odoo#103626

Taskid: 3032232
X-original-commit: c32c22ec267626322aebb7af4ee36b573c71760d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-10-20 14:14:48 +02:00
Malay Khamar 3ed061b849 [FIX] hr_holidays: Fixed to remove supporting documents after uploaded
closes odoo/odoo#101560

X-original-commit: 72697005df46c148aa649c27430739ad0d520880
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-04 09:55:43 +02:00
Dossogne Bertrand a3313df2f0 [FIX] hr_holidays: remove default working hours on stress days
If you create stress days, the default work calendar is set to be
the company's default calendar, therefore exclude by default
every employee with a different work calendar. Since the field
is by default hidden, it is misleading, so by default no calendar
should be set.

task-2999197

closes odoo/odoo#101986

X-original-commit: 911832980786cc10bb79c7b36b2142d063917bff
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-04 08:30:38 +02:00
Kevin Baptiste 2c8226b7aa [FIX] hr_holidays: properly reset time off type
When selecting multiple employees, the time off type was not
automatically reset and would show time off types not available (due to
missing allocations) to some of the employees.

task-3002165

closes odoo/odoo#101829

X-original-commit: fbafe1992865a8ba492cc43bab17ae68df9eb994
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-03 08:59:57 +02:00
Kevin Baptiste f90e5a5300 [IMP] hr_holidays: migrate calendar views to Owl
task-2991495

closes odoo/odoo#101658

X-original-commit: fb2dfd438c240848c4410b040d2177e4ff6a71b3
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-29 20:51:00 +02:00
Kevin Baptiste ce720181f7 [FIX] hr_holidays: make stress days working again
Since #97888 it was possible to request a leave during a stress day that
covered multiple day due to a typo in the logic.

task-2995191

closes odoo/odoo#101171

X-original-commit: 7fdb1a9980adeb5fded58b6715c3c6a5b66099ed
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-26 18:00:09 +02:00
Kevin Baptiste 5642ea4a15 [FIX] hr_holidays: fix leave responsible cleanup again
The method `_clean_leave_responsible_users` is also called from the
write method in hr.employee, however not anyone can remove users from
groups.

Fix of the fix in odoo/odoo#100591

closes odoo/odoo#100923

X-original-commit: 129e4799b04210f107185ba96b5c1845d943cf8b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-23 09:21:40 +02:00
Kevin Baptiste afdecd5ab1 [FIX] hr_holidays: fix leave responsible cleanup
Members of the `base_erp_manager` group are allowed to create new users
but don't necessarily have access to `hr.employee` records, making the
`read_group()` fail in those instances.

Part-of: odoo/odoo#100775
2022-09-22 08:46:50 +02:00
Dossogne Bertrand 2a41d237fe [FIX] hr_holidays: show correct remaining leaves value
On the employee page, the employe's remaing leaves
were computed using the allocations. Now that leaves
and allocations are not linked directly, the value
needs to be computed differently.

task-2971148

closes odoo/odoo#100458

X-original-commit: adc29a685ed934f45f8c4bbc482866e8a4f49471
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-19 09:33:44 +02:00
Philippe Wauthy 68c76f479b [FIX] hr_holidays: fix banner and days count
In hr_holidays, the banner disappears when the number of days taken is more than the days allocated.
Also, the count of the days is based on all existing allocations.

This commit fixes the banner by allowing to display negative days remaining when there are more days taken than days allocated.
It also fixes the count of the days by couting days only for active allocations.

task-2983188

closes odoo/odoo#100452

X-original-commit: efb351f86a3645ad292fdaaa6b223ff80096b63c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
2022-09-18 18:52:42 +02:00
Philippe Wauthy 8b6f1a195a [FIX] hr_holidays: delete calendar event when time off is deleted
Since https://github.com/odoo/odoo/pull/76722, it is possible to cancel an approved time off.
However, the calendar event created when the leave is validated is not archived when the leave is cancelled.

This commit archives the calendar event when the leave is cancelled.

task-2965754

closes odoo/odoo#100413

X-original-commit: d292891997a378578e072cfb01bba612501aa82a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
2022-09-18 15:26:46 +02:00
Dossogne Bertrand 148263cf90 [IMP] hr_holidays: make stress days department-specific
This commit adds the possibility to link a stress day
to specific departments. If the employee is in a
sub-department of the department subject to a stress
day, the stress day will also apply for that employee.

taskID 2946420

closes odoo/odoo#97888

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-09 11:12:02 +02:00
Philippe Wauthy de47062e7c [FIX] hr_holidays: fix timezone issue
To reproduce the issue, set the local timezone of the computer and the user to Pacific/Auckland.
Create a new time off from the dashboard.
The date_from and date_to are one day apart.

task-2885980

closes odoo/odoo#99072

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-08 13:50:42 +02:00
mafo-odoo 11713bfb1d [FIX] hr_holidays: accross two years accrual plans period fail:
Steps to reproduce:
- Create Accrual plan to add 3 days with frequency Yearly on 1 of
January and days lost at the end of the year
- Submit an Allocation request for this accrual plan starting more than
2 years ago
- Run scheduled action "Accrual Time: Updates the number of time off"

Current behavior:
Allocation request calculation time off computes 0 hours

Expected behavior:
Allocation request calculation time off computes 3 hours for the
period between the first of last year and the first of this year

Explanation:
With this modification there are two changes:

1) When the attribution day is the first of january, the nextcall
set in the _end_of_the_year_accrual is the first day of next
year meaning that no days are going to be computed for the last
year period. We change that so that if the first of the year is
the attribution day then the first of the year is the nextcall and
the last call is computed accordingly.

2) If the period to compute the attributed days is acrros two years
the begining of the period is not the first of the year anymore but
the usual lastcall, this has an impact particularly on based on
worked time accrual plans.

opw-2948216

closes odoo/odoo#99728

X-original-commit: 88ba0e68c7878ac4b45cd7103bfecf9cfb567d4f
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-08 01:08:08 +02:00
Philippe Wauthy f77840cfc7 [IMP] hr(_holidays): improve department filters
In the Employees app, when using the department kanban view and clicking on the
Time Off Requests or Allocation Requests, it leads to a tree view but the department
from which the user comes from is not part of the filters.

This commit adds the department in the filters of the tree view.

Due to the search panel being present in the tree view, the department filter is removed from the list of
filters to avoid a duplication of the filters in the search panel.

task-2939207

closes odoo/odoo#97773

Related: odoo/enterprise#30358
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-07 12:41:09 +02:00
Odoo's Mergebot f93e04253f [MERGE] hr_homeworking: Add employee work location mechanism
Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#98242

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-06 10:58:06 +02:00
Philippe Wauthy c77e6f4bb4 [FIX] hr_holidays: fix leaves calculation when no allocation is required
Since https://github.com/odoo/odoo/pull/96545, the calculation of the leaves
taken was done the same way between a holiday type that requires an allocation or
one that doesn't.

This commit fixes the number of days calculation for a holiday type that doesn't require an allocation.

task-2969687

closes odoo/odoo#99546

X-original-commit: https://github.com/odoo/odoo/commit/e6b51b0a7180298cfa04cd61b754cea660eae156
Signed-off-by: phwa-odoo <phwa@odoo.com>
2022-09-05 20:13:11 +02:00
mafo-odoo 4e6e3e6261 [FIX] hr_holidays: no date_from creates error
Probem:
With some time off type as default type in an allocation request
you get a traceback as soon as you try to open the allocation
request form.

Cause:
FIX commit [1] introduced the issue as it didn't consider the
possibility of a false date_from

Improvement 1:
Having a date_from False sets a False in the leave request name
displayed on the form, we change that to have an empty string
instead

Improvement 2:
The timezone bug fix in commit [1] is only applied on a specific
configuration, we applie it to all configuration of leave request
name

[1] 5a50dea2652cff014d9198f59265cf36a3ec1865

opw-2961344

closes odoo/odoo#99454

X-original-commit: 3b9a012e4a0839bc5da2daf51d56591d2863b4be
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-09-02 15:27:59 +02:00
Rob Coekaerts 351bcdbb41 [REF] hr: Split hr_icon_display into two separate fields.
The icon that is displayed in the employee kanban view is determined by the
field hr_icon_display, computed in the method _compute_hr_icon_display. This
method is overridden in multiple modules such as hr_holidays, hr_attendance
and hr_homeworking.

Currently this field has a state to show no icon (presence_undetermined). In
this change this state is extracted into the a separate field
show_hr_icon_display with the default state of hr_icon_display being
presence_to_define. In this way a module such as hr_attendance, which only
overrides _compute_hr_icon_display to show the default icon for everyone as a
default, now only needs to change this separate field and does not need any
knowledge of what other states exist. This reduces coupling between modules.
2022-09-02 13:18:33 +02:00
Sébastien Theys 545d23888b [IMP] mail, im_livechat, *: add typing for guest and clean code
* = bus, hr_holidays, test_discuss_full

- use channel member instead of partner for typing
- use channel member instead of partner for all other return values from server
- remove temporary partner hack in livechat and keep public partner
- remove some obsolete convert data
- adapt format methods accordingly

task-2664853

closes odoo/odoo#98923

Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-01 20:21:58 +02:00
Kevin Baptiste b41d6685df [FIX] hr_holidays: properly show remaining half-days
Since odoo/odoo#96545 the number of half-days remaining were not
correct. It was showing the number of hours as days.

task-2964068

closes odoo/odoo#99055

X-original-commit: 8734ea55b4070fcc361d395923621bede94c1998
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-08-31 16:05:28 +02:00
William Braeckman 498b9476d3 [IMP] hr_holidays: improve days calculation based on worked time
Prior to this commit accrual levels based on worked time did not
properly compute the number of days when the period prorata was taken
into account.

TaskId-2924364

closes odoo/odoo#99183

X-original-commit: d9000d3d883ab6fa8325692f1ac5249d6822046a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-30 08:19:06 +02:00
Philippe Wauthy d57aba65fa [FIX] hr_holidays: remove allocation_id on hr.leave
As part of hr_holidays B2B, the holidays allowances were moved from hr_leave_type to hr_leave_allocation.
This didn't allow to take a leave longer than the maximum duration of an allocation. Also, despite all the
allocations could have enough days for a certain leave, it was not possible to use all available days without
splitting the leaves across the different allocations.

This commit moves the holidays allowance to the hr_leave_type to remediate the issues described above.

task-2834887

closes odoo/odoo#98317

X-original-commit: 8c37d5c7cc397e517c43c1ec13a131b4b35e48b7
Signed-off-by: phwa-odoo <phwa@odoo.com>
2022-08-18 00:23:40 +02:00
tronghung0398 f45d8ecde6 [FIX] hr_holidays: fix the error of displaying wrong timezone
closes odoo/odoo#97965

X-original-commit: 16ea6416d46b568541df4c1d76e0fa4f15dad06a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-16 09:19:02 +02:00
tronghung0398 de51970c7d [FIX] hr_holidays: Fix the wrong timezone display
closes odoo/odoo#98064

X-original-commit: ec462b8361e03516905eb38c041ad511b1604896
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-12 19:05:32 +02:00
William Braeckman 4f35751bb0 [FIX] hr_holidays: fix accrual level maximum leaves
A test introduced with https://github.com/odoo/odoo/pull/96432
revealed an issue with the level limits for the accrual plans.

The only applied limit was the one of the current level at the end of
the run, however if for whatever reason multiple levels had to be
processed at once (if the database was shut down for a long period of
time for example), the individual levels would not apply any limit logic
to their behaviour which meant that you could have a different behaviour
between running the cron each day and running it after a long period.

This commit aims to fix that issue by applying the said limit.

OPW-2868297

closes odoo/odoo#97540

X-original-commit: 09fa1020f42d641fc0011d482cdd08aea4f4085a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-05 08:11:45 +02:00
mafo-odoo 4c263e0423 [FIX] hr_holidays : wrong number of days for multilevel accrual plan
Steps to reproduce:
- Create an accrual plan and an allocation request such as described
in the added test and validate the allocation request
- Run the scheduled action for accrual plan computation
- Check the number of allocated days

Expected behavior:
The first level should bring 6 days, the second 3 days and the last
1 day for a total of 10 days

Current behavior:
The 3 level give non integer values closed to the expected for a
total of 9,... days.

Explanation:
When transiting between two levels the nextcall was the last day
of the current level to have the right level, this creates an
inconsistency as the end_date of the _process_accrual_plan_level
level should go up to the first day of the next level to have the
full number of days expected. To solve the issue we change the
level selection so that if the date is the first day of the
level it is still in the previous level. We also modify the places
where the nextcall was modified when transiting level so that there
is no more one day delta anymore.

opw-2868297

closes odoo/odoo#96665

X-original-commit: 5d055130c97c5d8367c2b71fc617f588c5e15741
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-07-27 04:53:37 +02:00
Yannick Tivisse 3bfcf83db7 [IMP] hr_holiday: Ensure persistence of number_of_hours_display
Purpose
=======

Base the number_of_hours_display on the company calendar instead of the
employee calendar to avoid modifying the informative allocated value
in case of a working schedule change.

closes odoo/odoo#96419

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-22 10:22:48 +02:00
William Braeckman 1741b1552e [FIX] hr_holidays: fix a bad call to relativedelta
This commit fixes a bad call to relativedelta missing a `day` key for an
argument.

closes odoo/odoo#95705

X-original-commit: b59e81b6c34e7a4e2f35cf719c811883b289ddb5
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-09 22:58:10 +02:00
mafo-odoo 92ef335bee [FIX] hr_holidays: negative allocation in accural plan
Steps to reproduce:

- Create an accural plan with two levels, the first should have
its action_with_unused_accruals set as lost. The second should
start one year after the first level.
- Use this plan on a employee and make it start the first day of
the previous year.

Current behavior:
The number of allocated day is wrong and can even be negative

Expected behavior:
The days of the first level are lost and there is the right amount
of allocated days,

Eplanation:
The _end_of_the_year function was first designed to be only called
on the first day of the year but the it changed since then without
updating it's content and it can calle any day of the year now. In
this case the use of today() does not make sense and it should be
replaced by the first day of the current year.

opw-2868297

closes odoo/odoo#94897

X-original-commit: 476818972e93b32df6f25cf299f631a8f7eb3af4
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-30 08:23:02 +02:00
Fabio Barbero dc66b7aec3 [IMP] mail, various: use overridden method in message_notify
Purpose
=======

In message_notify, when called on a recordset, call model methods instead of
base one defined on MailThread. This allows to use internal methods overrides.

Also perform some linting on calls to ``message_notify`` in order to better
spot calls, parameters, ...

Task-2852908

closes odoo/odoo#92868

Related: odoo/enterprise#28038
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-18 10:23:03 +02:00
Dossogne Bertrand 921dd26ba8 [IMP] hr_holidays: automatic time-off recovery after public holiday edit
If a public holiday is created, modified or deleted,
all declared (non-refused) leaves related to that period will have
their duration re-evaluated and individual remaining time offs will
be computed accordingly.
If the duration of the leave is evaluated at 0 after the creation
of the public holiday, the leave will be set as cancelled.

task-2636215 [Time Off]Grant back time off when public day off is created

closes odoo/odoo#81225

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 08:57:40 +02:00
mafo-odoo 3a4cb6f59a [FIX] hr_holidays: right responsible for validation type set
Steps to reproduce:
- Create a Time off Type for which an allocation can be requested
by the employee and with approval "Set by Time Officer"
- Set a Time Off approver on the employee
- Create an allocation

Current behavior:
The allocation approval activity is assigned to the employee

Expected behavior:
The allocation approval activity is assigned to the time off officer

Explanation:
The first fix commit c2bac984f2de160008b27fb52b1d0ae7abd02abb didn't
take into consideration the "Set by Time Officer" approval, we add
here this possible value "set" in order to have a complete fix.

opw-2849972

closes odoo/odoo#92608

X-original-commit: 7239fad29c4b409097ba2a0d2f92d8b9fa8fd5ca
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-06-01 12:14:13 +02:00
Raphael Collet 6cf8db906f [REF] *: adapt code to new flush API
closes odoo/odoo#87527

Related: odoo/upgrade#3497
Related: odoo/enterprise#26939
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-05-25 18:00:47 +02:00
Philippe Wauthy c934652660 [IMP] hr_holidays: set time off default employee when created from allocation smart button
In hr_holidays, each allocation granted to an employee has a smart button to see the linked
time off for this employee.
The create button on the tree view that shows these time off opens the form
with self.env.user.employee_id as default employee.

This commit changes the default employee of the time off to be the one of the original allocation

task-2844554

closes odoo/odoo#90739

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-24 14:50:48 +02:00
mafo-odoo 2088ead0de [FIX] hr_holidays: right repsonsible for leave approval activity
Steps to reproduce:
- Create a Time off Type for which an allocation can be requested
by the employee and approved by the time off officer

- Set a Time Off approver on the employee

- Create an allocation

Current behavior:
The allocation approval activity is assigned to the employee

Expected behavior:
The allocation approval activity is assigned to the time off officer

Problem
The function _get_responsible_for_approval used the validation types
of v14 instead of the one of v15.

XML modification:
While using the form for the time off types I notice that the logic
was incomplete for the "responsible time off officer" invisible and
required fields. the field can not be invisible if the approved by
time off officer is set and it should be required to avoid errors.

opw-2849972

closes odoo/odoo#92067

X-original-commit: 2e2b89eed31e74cb6123f065c7790726753d585d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-23 15:12:58 +02:00
Dossogne Bertrand c5dff04665 [IMP] hr_holidays: improve cancel interface
This commit aims to improve the time off experience by:
- fixing the "cancelled" ribbon on time offs
- removing the archive dropdown action
- removing the "off until" banner in discuss if the user's leave is not validated

TaskID 2800647

closes odoo/odoo#87650

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-20 15:25:13 +02:00
tranngocson1996 85a754b38c [FIX] hr_holidays: delete old code
With new key of `allocation_validation_type` field, this code is no
longer relevant

closes odoo/odoo#91464

X-original-commit: 89faeeab7efe3bcc629bd4d48f44eb9a55bee9ec
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-16 15:10:06 +02:00