From 12ea19d1078e3121e5fce9b19192dbc4d212544a Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Mon, 9 Sep 2024 15:52:42 +0200 Subject: [PATCH] [IMP] resource_multi_week_work_time_from_contracts: Move domain from view to model Signed-off-by: Carmen Bianca BAKKER --- .../__manifest__.py | 3 --- .../models/hr_contract.py | 15 ++++++++++++++ .../views/hr_contract_views.xml | 20 ------------------- 3 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 resource_multi_week_work_time_from_contracts/models/hr_contract.py delete mode 100644 resource_multi_week_work_time_from_contracts/views/hr_contract_views.xml 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)] - - - -