diff --git a/resource_multi_week_work_time_from_contracts/__manifest__.py b/resource_multi_week_work_time_from_contracts/__manifest__.py index 5c873ce1..0597db75 100644 --- a/resource_multi_week_work_time_from_contracts/__manifest__.py +++ b/resource_multi_week_work_time_from_contracts/__manifest__.py @@ -18,7 +18,4 @@ "resource_work_time_from_contracts", ], "auto_install": True, - "data": [ - "views/hr_contract_views.xml", - ], } diff --git a/resource_multi_week_work_time_from_contracts/models/hr_contract.py b/resource_multi_week_work_time_from_contracts/models/hr_contract.py new file mode 100644 index 00000000..c7252be8 --- /dev/null +++ b/resource_multi_week_work_time_from_contracts/models/hr_contract.py @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2024 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from odoo import fields, models + + +class HrContract(models.Model): + _inherit = "hr.contract" + + # Add a domain. + resource_calendar_id = fields.Many2one( + "resource.calendar", + domain="[('parent_calendar_id', '=', False)]", + ) diff --git a/resource_multi_week_work_time_from_contracts/views/hr_contract_views.xml b/resource_multi_week_work_time_from_contracts/views/hr_contract_views.xml deleted file mode 100644 index d5ba4d12..00000000 --- a/resource_multi_week_work_time_from_contracts/views/hr_contract_views.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - hr.contract.form - hr.contract - - - - [('parent_calendar_id', '=', False)] - - - -