'Returns a float equals to the timedelta between two dates given as string.'

def _get_number_of_days(self, date_from, date_to, employee_id):

    from_dt = fields.Datetime.from_string(date_from)
    to_dt = fields.Datetime.from_string(date_to)
    if employee_id:
        employee = self.env['hr.employee'].browse(employee_id)
        resource = employee.resource_id.sudo()
        if (resource and resource.calendar_id):
            hours = resource.calendar_id.get_working_hours(from_dt, to_dt, resource_id=resource.id, compute_leaves=True)
            uom_hour = resource.calendar_id.uom_id
            uom_day = self.env.ref('product.product_uom_day')
            if (uom_hour and uom_day):
                return uom_hour._compute_quantity(hours, uom_day)
    time_delta = (to_dt - from_dt)
    return math.ceil((time_delta.days + (float(time_delta.seconds) / 86400)))
