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
closesodoo/odoo#97540
X-original-commit: 09fa1020f42d641fc0011d482cdd08aea4f4085a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit converts the radio image field of hr_timeoff
to the new framework and renames the registry key to
time_off_radio_image.
closesodoo/odoo#97103
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
closesodoo/odoo#96665
X-original-commit: 5d055130c97c5d8367c2b71fc617f588c5e15741
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce:
- Create a leave request for multiple employees
- Go in the employee list
Current behavior:
The leave request is not visible in the list view
Expected behavior:
The leave request is visible in the list view
Explanation:
Previously a domain on the list view restricted the
records to the one that had an employee_id with the
right company but this condition was never met by the
the multi_employee leaves as they have no employee_id.
To solve the issue we add to the domain a condition to
accept multi_domain employee that have the right state
and the right company.
opw-2917291
closesodoo/odoo#96625
X-original-commit: f1c7c3737d3420a1356fd8e24d7970edcdb571c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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.
closesodoo/odoo#96419
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, if you are on the time off dashboard calendar of a company
that is not set as your user's default company, no time off is displayed.
Also, if you try to consult your time offs on the dashboard tree view and if
you have one leave with a leave_type without company on a company that is not
the one you're logged in, you'll get a access error.
This commit fixes both issues.
taskID 2893659
closesodoo/odoo#96199
X-original-commit: 6e604bd8bb1d6011482a9ce1778a71a108d0c610
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In hr_holidays, the duration field is editable but doesn't bring any added value.
The field is errorprone and not editable if you are not HR Officer. It should be the same in every case.
The duration field should be read only on the dashboard and time off creation screens.
task-2901951
closesodoo/odoo#95534
Related: odoo/enterprise#29352
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit fixes a bad call to relativedelta missing a `day` key for an
argument.
closesodoo/odoo#95705
X-original-commit: b59e81b6c34e7a4e2f35cf719c811883b289ddb5
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
In the web client, in a real use case, it's not possible
to write on fields which are invisible,
as it's not possible to write on fields which are readonly.
This is a first step in the goal to change the behavior
of the `groups=` attribute in the back-end views,
to remove them for the view instead of making them invisible.
This is mainly to reduce the diff of the revision that will introduce
the mentioned above behavior change.
As nodes with `groups=` will be removed from the view
when the user doesn't have the group, it's no longer possible
to set a value on a field having a `groups=` the user doesn't have
in the `Form` test class, as the field will no longer be at all in the
view.
However, these unit tests shouldn't have been able to set values
on invisible fields in the first place.
This revision therefore aims to correct the unit tests setting value
on fields which were invisible because the user executing the
test was not part of the required group(s) for these fields
to be visible in the view.
closesodoo/odoo#94337
Related: odoo/enterprise#28936
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
> Media query mixins parameters have changed for a more logical approach
> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).
https://getbootstrap.com/docs/5.1/migration/#sass
Task ID: 2766483
Part-of: odoo/odoo#95450
It seems louche to use media-breakpoint-between(lg, xl,
$o-extra-grid-breakpoints) as in $o-extra-grid-breakpoints there is an
XXL value.
In short, in XXL mode the padding fallback to the value outside the
breakpoint (twice smaller).
e.g. result in CSS
```css
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-right: 16px;
padding-left: 16px;
}
@media (min-width: 992px) and (max-width: 1533.98px) {
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-right: 32px;
}
}
@media (min-width: 992px) and (max-width: 1533.98px) {
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-left: 32px;
}
}
```
Part-of: odoo/odoo#95450
The test was randomly failing on nightly builds as the timeoff was
considered as started, thus preventing the user from modifying it.
closesodoo/odoo#95010
X-original-commit: 95f84086d15ed0a139e4e145dc2422a949f1ae95
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).
It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...
Part-of: odoo/odoo#92475
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
closesodoo/odoo#94897
X-original-commit: 476818972e93b32df6f25cf299f631a8f7eb3af4
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/odoo#92868
Related: odoo/enterprise#28038
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Now that it potentially contains guests, the previous name is no longer correct.
Part of task-2883466
closesodoo/odoo#93731
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
And use it on partner im status.
This will allow displaying the im status of guest without any other change to
components.
Part of task-2883466
Part-of: odoo/odoo#93731
When the duration of an approved time off is changed from the time off dashboard,
the holiday_status_id field is no longer editable in the form, only the duration of the leave.
This causes a traceback due to the custom form controller to update the name of the time off type
based on the allocations available.
closesodoo/odoo#93858
X-original-commit: b87e672e1e5367d774dee2de6a7c76374cc2da39
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
STEPS:
* switch to serbian language
* start chat with a user who is out of office
* refresh page
BEFORE: Incorrect locale information provided
AFTER: no errors
Similar change for web module in v15: https://github.com/odoo/odoo/commit/1bb9cb89c8b5b5c55299afd3c53df14c3aea5ee7
opw-2859402
closesodoo/odoo#93479
X-original-commit: 3102b5e9cecbc973d5f774051d556d9387a8ee38
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The "Time Off Analysis" report was showing Archived (aka canceled) time
off, which was confusing/misleading.
closesodoo/odoo#92778
Taskid: 2864419
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/odoo#81225
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/odoo#92608
X-original-commit: 7239fad29c4b409097ba2a0d2f92d8b9fa8fd5ca
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Timeoff is apply in the view to take effect on every view type
instead of only the calendar.
closesodoo/odoo#92027
X-original-commit: 3b89abcc3def129b91221eb983a5a936670d7b9c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/odoo#90739
Signed-off-by: Kevin Baptiste <kba@odoo.com>
*: hr, hr_holidays, im_livechat, test_mail.
The target returned by the mail's test utils start method is useless since it's
almost the same thing than querying document. Let's remove it and replace it by
document. This will reduce the diff in the PR introducing the new environment in
the discuss app.
task-2582313
closesodoo/odoo#92077
Related: odoo/enterprise#27670
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The recruitment kanban view was redesigned and it looks good, so it was
decided to implement the same design on the department kanban view. This commit
adds the number of employees to the "Employees" button and makes the kanban
cards wider.
task-2849418
closesodoo/odoo#91293
Related: odoo/enterprise#27324
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/odoo#92067
X-original-commit: 2e2b89eed31e74cb6123f065c7790726753d585d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/odoo#87650
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Prior to this commit cancelled time off were included in the leave
report calendar model and were shown as regular time offs.
They will now be hidden.
closesodoo/odoo#91675
X-original-commit: c8d17c760e27736d0cb809b59e9945f808b1138e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
With new key of `allocation_validation_type` field, this code is no
longer relevant
closesodoo/odoo#91464
X-original-commit: 89faeeab7efe3bcc629bd4d48f44eb9a55bee9ec
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Currently traceback occurs if allocation leave is approved.
It has been fixed.
closesodoo/odoo#91402
X-original-commit: 7699f6b9105c2d810b5ddc0446943670c5cbbd22
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
There are several instances in TestAccrualAllocations where freezetime is used on a dynamic date.
This fix freezes the time to an iconic date.
task-2853089
closesodoo/odoo#91316
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The field "Kind of leave" was a bit confusing, here we re-word the
labels to make clearer what is its purpose.
closesodoo/odoo#90942
Taskid: 2693319
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In case we try to delete an allocation, we should add a check if there
are already taken leaves, otherwise it could lead to an incoherent
situation with validated leaves without allocation while their
associated time off type is requiring allocation.
closesodoo/odoo#90932
X-original-commit: 45567dddacae82f9b4e985703cbb9e7736e9beb0
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>