[FIX] hr_contract: Track some missing fields on contracts
closes odoo/odoo#157012 Related: odoo/enterprise#58326 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -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')
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user