Rob Coekaerts 7359c6de08 [IMP] hr_holidays: Remove leave splitting
Currently when a global leave is removed or modified in such a way that
the duration of an existing leave increases, the leave is instead split
into multiple leaves with a gap in between such that it no longer
includes the period that was previously covered by the global leave.

However, this splitting is very error-prone and from a user perspective
is not even always the behaviour that is expected, especially because
editing global leaves is a very low-threshold operation during which it
is in no way indicated that existing leaves might be impacted.

Also note that this is very specific edge case, that in normal operation
should almost never occur. It is therefore best to simply use an
approach that has a minimal impact on the codebase complexity and
produces no unexpected results for the end user.

Therefore in this commit, we handle this case in the following way:
  - If a global leave is created or extended in duration, we simply
    recompute the impacted leave durations (as was the case before).
  - If a global leave is shortened in duration or deleted, the durations
    of the affected leaves are also recomputed, but:
    - In the case that existing allocations can cover this increase in
      leave duration, the leave is left 'as is', but the user is
      notified that additional allocation time has been taken.
    - In the case that existing allocations cannot cover this increase,
      the user is again notified, but the leave is additionally reset to
      the 'draft' state (to prevent the allocation from going negative,
      which is impossible).

With this approach, it now up to the user to handle this specific edge
case, while no information is changed or lost, which was possible to
happen with the previous approach.

Part-of: odoo/odoo#119317
2023-09-26 09:32:27 +00:00
2023-09-25 15:20:25 +00:00
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%