[FIX] hr_holidays: fix wrong employee_id fallback

A wrong fallback value was used, the domain is expecting the employee ID
and not the employee record.

closes odoo/odoo#80663

Taskid: 2675380
X-original-commit: 6e68df1a69079bc16888ad588c97f234c9b9fa07
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Kevin Baptiste
2021-12-01 11:05:14 +00:00
parent 581056425f
commit a790a241da
+1 -1
View File
@@ -147,7 +147,7 @@ class HolidaysType(models.Model):
def _compute_valid(self):
date_to = self._context.get('default_date_to', fields.Datetime.today())
date_from = self._context.get('default_date_from', fields.Datetime.today())
employee_id = self._context.get('default_employee_id', self._context.get('employee_id', self.env.user.employee_id))
employee_id = self._context.get('default_employee_id', self._context.get('employee_id', self.env.user.employee_id.id))
for holiday_type in self:
if holiday_type.requires_allocation:
allocation = self.env['hr.leave.allocation'].search([