From e365e22485dc45f1cbe87ae93395b022a4724a3c Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 8 Mar 2024 08:49:20 +0100 Subject: [PATCH] [FIX] hr_contract: Track some missing fields on contracts closes odoo/odoo#157012 Related: odoo/enterprise#58326 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_contract/models/hr_contract.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_contract/models/hr_contract.py b/addons/hr_contract/models/hr_contract.py index 6af80d20572..d6e224c62d5 100644 --- a/addons/hr_contract/models/hr_contract.py +++ b/addons/hr_contract/models/hr_contract.py @@ -23,7 +23,7 @@ class Contract(models.Model): name = fields.Char('Contract Reference', required=True) active = fields.Boolean(default=True) - structure_type_id = fields.Many2one('hr.payroll.structure.type', string="Salary Structure Type", compute="_compute_structure_type_id", readonly=False, store=True) + structure_type_id = fields.Many2one('hr.payroll.structure.type', string="Salary Structure Type", compute="_compute_structure_type_id", readonly=False, store=True, tracking=True) employee_id = fields.Many2one('hr.employee', string='Employee', tracking=True, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", index=True) department_id = fields.Many2one('hr.department', compute='_compute_employee_contract', store=True, readonly=False, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", string="Department") @@ -36,7 +36,7 @@ class Contract(models.Model): help="End date of the trial period (if there is one).") resource_calendar_id = fields.Many2one( 'resource.calendar', 'Working Schedule', compute='_compute_employee_contract', store=True, readonly=False, - default=lambda self: self.env.company.resource_calendar_id.id, copy=False, index=True, + default=lambda self: self.env.company.resource_calendar_id.id, copy=False, index=True, tracking=True, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]") wage = fields.Monetary('Wage', required=True, tracking=True, help="Employee's monthly gross wage.", group_operator="avg") contract_wage = fields.Monetary('Contract Wage', compute='_compute_contract_wage') @@ -52,7 +52,7 @@ class Contract(models.Model): default=lambda self: self.env.company, required=True) company_country_id = fields.Many2one('res.country', string="Company country", related='company_id.country_id', readonly=True) country_code = fields.Char(related='company_country_id.code', depends=['company_country_id'], readonly=True) - contract_type_id = fields.Many2one('hr.contract.type', "Contract Type") + contract_type_id = fields.Many2one('hr.contract.type', "Contract Type", tracking=True) contracts_count = fields.Integer(related='employee_id.contracts_count') """