Files
odoo_source/addons/hr_contract/tests
Levi Siuzdak (sile) 8faed465fc [FIX] hr{,_contract,_holidays}: default to company calendar
Versions
--------
- 17.0+

Steps
-----
1. Go to Employees app as admin;
2. clear the "Working Hours" field & save;
3. go to Time Off app.

Issue
-----
Odoo Server Error.

Cause
-----
Commit 8f87e102a9 added the
`_get_consumed_leaves` method to `hr.employee`, which calls on
`resource.calendar` methods with `ensure_one()` active. The
`resource_calendar_id` is not a required field for employees, so an
error occurs when these methods are called on an empty record.

Solution
--------
Default to `company_id.resource_calendar_id` where a calendar is
expected.

Also fixes a potential issue in `hr_contract` when getting attendances
between a time interval that includes multiple contracts using different
calendars.

opw-3665412

closes odoo/odoo#149908

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2024-01-25 13:42:45 +00:00
..
…