[FIX] hr_holidays: Improve dashboard loading time
closes odoo/odoo#150857 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -24,7 +24,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)
|
||||
employee_id = fields.Many2one('hr.employee', string='Employee', tracking=True, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
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")
|
||||
job_id = fields.Many2one('hr.job', compute='_compute_employee_contract', store=True, readonly=False,
|
||||
|
||||
@@ -365,7 +365,7 @@ class HolidaysType(models.Model):
|
||||
'|',
|
||||
('company_id', 'in', self.env.context.get('allowed_company_ids')),
|
||||
('company_id', '=', False),
|
||||
])
|
||||
], order='id')
|
||||
employee = self.env['hr.employee']._get_contextual_employee()
|
||||
if employee:
|
||||
return leave_types.get_allocation_data(employee, target_date)[employee]
|
||||
|
||||
Reference in New Issue
Block a user