[FIX] hr_holidays: compute duration in leave's import

Before this commit, the duration (days/hours of the leave) wasn't
compute when importing leaves.

opw-1916913

closes odoo/odoo#35167

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
Jorge Pinna Puissant
2019-07-25 07:42:30 +00:00
parent fd7ce4c983
commit f45564ae94
+2
View File
@@ -532,6 +532,8 @@ class HolidaysRequest(models.Model):
if not values.get('department_id'):
values.update({'department_id': self.env['hr.employee'].browse(employee_id).department_id.id})
holiday = super(HolidaysRequest, self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True)).create(values)
if self._context.get('import_file'):
holiday._onchange_leave_dates()
if not self._context.get('leave_fast_create'):
holiday.add_follower(employee_id)
if 'employee_id' in values: