[FIX] hr_holidays: correct condition with requires allocation

The field `requires_allocation` is a selection field
that is required.
Using it in an if statement without a comparison
operation will always return true.

opw-3274826

closes odoo/odoo#118854

X-original-commit: 486498ddf1d29c7fc58107e83421686ace30ff4f
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
This commit is contained in:
Thomas Lefebvre (thle)
2023-04-18 07:21:57 +02:00
parent 5e637beeb9
commit 9b7c74cadc
+1 -1
View File
@@ -141,7 +141,7 @@ class HolidaysType(models.Model):
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.id))
for holiday_type in self:
if holiday_type.requires_allocation:
if holiday_type.requires_allocation == 'yes':
allocation = self.env['hr.leave.allocation'].search([
('holiday_status_id', '=', holiday_type.id),
('employee_id', '=', employee_id),