From 5c7b714cb2eeb85446e2ce03a9e091810400a469 Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Fri, 31 Mar 2023 07:15:52 +0000 Subject: [PATCH] [REV] add domain to select current company calendar This reverts commit 94bbffe46bebba117d80eded2a9160b3ab7c0ba3 introduced in #109904. This change was bringing more issues than it was trying to solve. task-3254874 Part-of: odoo/odoo#117663 --- addons/hr_contract/models/hr_payroll_structure_type.py | 2 +- addons/hr_contract/models/resource.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/hr_contract/models/hr_payroll_structure_type.py b/addons/hr_contract/models/hr_payroll_structure_type.py index ef5a7bd84bb..d021d7ef2c6 100644 --- a/addons/hr_contract/models/hr_payroll_structure_type.py +++ b/addons/hr_contract/models/hr_payroll_structure_type.py @@ -11,5 +11,5 @@ class HrPayrollStructureType(models.Model): name = fields.Char('Salary Structure Type') default_resource_calendar_id = fields.Many2one( 'resource.calendar', 'Default Working Hours', - default=lambda self: self.env.company.resource_calendar_id if self.env.company.country_id else False) + default=lambda self: self.env.company.resource_calendar_id) country_id = fields.Many2one('res.country', string='Country', default=lambda self: self.env.company.country_id) diff --git a/addons/hr_contract/models/resource.py b/addons/hr_contract/models/resource.py index c3f1b427453..52316b92636 100644 --- a/addons/hr_contract/models/resource.py +++ b/addons/hr_contract/models/resource.py @@ -10,7 +10,6 @@ class ResourceCalendar(models.Model): _inherit = 'resource.calendar' contracts_count = fields.Integer("# Contracts using it", compute='_compute_contracts_count', groups="hr_contract.group_hr_contract_manager") - company_country_id = fields.Many2one('res.country', string='Country', related='company_id.partner_id.country_id') def transfer_leaves_to(self, other_calendar, resources=None, from_date=None): """