Files
odoo_source/addons/hr_holidays/data
sofiagvaladze 9b33797811 [FIX] hr_holidays: fix public holidays collision
In demo/data some places public holidays are fixed, and at
some places they are "moving" like - datetime.today() + relativedelta(days=+x)).

 On 06-01-2024 the following error occurred -
Two public holidays cannot overlap each other for the same working hours

This happened because the Indian public holiday - Makar Sakranti -
 is set on %Y-01-14 [1]

And the company is not set on it straight away. It is set in demo [2]

That leave overlapped with -Public Time Off [3] which is set as datetime.today() + relativedelta(days=+8)).
The public Time off, when server runs 06-01-2024, makes 14-01-2024.

As we can't set two public holidays on the same day, we got an error.

Note that this issue can be fixed in two ways:
 - either move Indian public holidays in demo data and assign company
   on creation,
 - or fix date_from of generic public holidays.

For now, we choose to fix generic public holidays, as it's demo data and
less important.

[1] https://github.com/odoo/enterprise/blob/fcc15c438a2bdb22f4dc7bcd33bbe78ce4f83246/l10n_in_hr_payroll/data/resource_calendar_leaves_data.xml#L23-L29
[2] https://github.com/odoo/enterprise/blob/fcc15c438a2bdb22f4dc7bcd33bbe78ce4f83246/l10n_in_hr_payroll/demo/l10n_in_hr_payroll_demo.xml#L13-L15
[3] https://github.com/odoo/odoo/blob/762b087aeeaea6e9bbea98795294503f21856ae2/addons/hr_holidays/data/hr_holidays_demo.xml#L451-L457

closes odoo/odoo#148424

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-01-10 05:04:40 +00:00
..