Xavier Morel d9a3206a16 [FIX] hr_holidays: cancel leaves when they get deleted
When validating leaves they generate a bunch of ancillary
objects (calendar events, resource calendar leaves).

When deleting leaves, those don't get removed, which is an issue when
uninstalling then reinstalling the module: because leaves use the
resource calendar to check availability, and how many working days the
leave covers, and because leaves must cover at least 1 working day
it's possible for the leftover calendar leaves to prevent creating hr
leaves.

Solve the problem by canceling the leave when it is deleted. This
should not be too much of an issue when deleting a leave normally as
`_unlink_if_correct_states` prevents deleting validated
leaves.

Sending the notifications is suppressed during uninstallation (seems
like most people involved would be aware the "time off" module is
getting removed), but for the case of a manual deletion it is probably
useful, especially as notifications are only sent for leaves in
`validate` and `validate1` states.

Part-of: odoo/odoo#121522
2023-05-16 15:55:38 +02:00
2023-05-11 12:01:49 +02: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%