When creating an allocation by employee tag if you copied any allocation
made, it was still linked to the parent allocation, hence when
confirming/refusing the parent allocation it would confirm/refuse the
copied one too.
Closes: #25106
It was possible to edit a leave request in order to use a leave type
which had no more days left. This was due to a missing field in the
constrains call.
Closes#24320
When changing the employee to None in an allocation,
this onchange raised an error because it attempted
to set an employee browser record (empty but still)
in a department many2one.
- Create a new leave allocation
- Try to change the field Mode (holiday_type) from "By Employee" to "By Employee Tag"
Fixes#23345
opw-1820069
- In SaaS-16 we have added a related on the employee's department.
This causes access rights issues when changing the employee's department.
We do not want to rewrite all the old records, only the new ones should use the new employee's department.
- In SaaS-16 we have added a related on the employee's manager as the manager of the leave.
This cause access rights issues when changing the employee's manager.
We do not want to rewrite all the old records, only the new ones should use the new manager.
A leave type now generate timesheet by default. So
the internal project/task are taken from the leave
type company (a default value for the company has
been added).
To allow the hr leave manager to select a project,
he should be alble to read the analytic account
(otherwise, crash when calling name_get).
Setting the default internal project/task is advanced,
so hidden in debug mode on timesheet config.
The stat button "Leaves Left" is a computed field of type integer.
However, it aggregates the data of `number_of_days`, which is a float.
Since the field is not stored, we can change its type.
opw-743153
In Python 3:
* various builtins and dict methods were changed to return
view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
removed altogether
This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).
Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.
issue #8530
This commit proposes to allow to automatically generate timesheet lines
when an employee is on leaves. Project and task used for timesheeting
is globally configured on the company. Holidays type choose whether to
generate timesheets or not and take the company default configuration.
When an HR officer validates a leave request, analytic lines will be
generated for each day off. The unit amount will be based on the working
calendar of the employee taking the leave. Generated timesheet lines are
attached to the project and task configured on the holidays type.
Configuring timesheet lines generation at holiday type level allows to
tune the use of leave requests. You may have for example "home working"
holiday type that should not generate timesheets while "legal leaves"
should.
hr_holiday was the only module that used a widget=toggle_boolean on a
button in a list view. That behaviour was implemented as a column
widget in the previous list view, and was not reimplemented in the new
views. The feature is useful, but this was not done properly: it is
better to use a widget on a field (that was the intent) instead of doing
a weird hack like it was done.
With this commit, we update hr_holidays to use the ToggleBoolean widget,
which is supposed to work on every views.
Also, we fix the toggleboolean widget (it was not properly rendering
tooltips, and changes were not saved in readonly list view).
Note that it as the side effect of being better from the point of rpcs:
before, the list view had to reload itself. Also, another advantage is
that models do not need to implement custom methods (such as
toggle_payslip_status) just to toggle a boolean...
The allocation requests have date fields that are only informative.
Having an allocation request (e.g. specifying dates of a public holiday)
overlapping the dates of a request is actually fine (if an employee is sick
during a public holidays, he can still use it for a leave request).
Closes#11026
Currently the manager fields have this meaning:
* manager_id: employee that approved the leave first;
* manager_id2: employee that approved the leave secondly;
It makes no sense. Furthermore, on the Leaves Dashboard, when you group
by Manager, you group by first approver, which is also a nonsense.
This commit improves the behavior
* rename manager_id and manager_id2 into first_approver_id and
second_approver_id in order to understand their meaning
* add a stored related field manager_id, readonly to avoid modifications
on the employee
* modify the views to only display the real employee manager, the other
values are not valuable on the views
* in code regularly a manager variable is used but is actually the
current employee; a renaming is then applied
Old methods are still present since a long time and are deprecated since
saas-3. This compatibility layer adds unnecessary complexity to the module
API. Those methods should now be removed. Some renaming is also performed
to ease resource api understanding, notably to better differentiate
internal methods from other methods.
All addons are updated accordingly.
The display label (e.g. "Legal leaves (5 remaining out of 20)") was not
translatable.
Add the 'remaining out of' as translatable.
Replaces and closes#15212
Purpose of this commit is to help user distinguish allocation and leave
requests. This is achieved through three improvements
* name_get is improved to display the holidays type
* type is tracked and therefore displayed in chatter messages
* button in notification emails depends on holidays type