**Impacted versions:**
11.0

**Steps to reproduce:**
In runbot odoo/odoo or odoo/enterprise

- In Preferences change the timezone to America/Mexico_city

- Create a contract for a user with this values: **state**: running, **End Date**: NULL, **Start Date**: year before (for example), and **working schedule**: Standard 40 Hours/week
![image](https://user-images.githubusercontent.com/19410285/35942162-2640db56-0c2b-11e8-8714-b25413d62123.png)

- Edit the working schedule as the image below, and save.
![image](https://user-images.githubusercontent.com/19410285/35942368-c846cf82-0c2b-11e8-9a26-753ded2509d1.png)

- Create a payslip for a user with the edited contract.

- Change the date_from (in period) to a saturday day
![image](https://user-images.githubusercontent.com/19410285/35942575-83626d08-0c2c-11e8-8023-11675d29c3ea.png)


**Current behavior:**
Take this error
![image](https://user-images.githubusercontent.com/19410285/35942631-ad048268-0c2c-11e8-9147-c3f2ff5770fe.png)


**Expected behavior:**
compute the number of days without error


**Video/Screenshot link (optional):**
https://youtu.be/fQWTg7LXD2g

addons/hr_payroll/models/hr_payslip.py
state = fields.Selection([
        ('draft', 'Draft'),
        ('verify', 'Waiting'),
        ('done', 'Done'),
        ('cancel', 'Rejected'),
    ], string='Status', index=True, readonly=True, copy=False, default='draft',
        help="""* When the payslip is created the status is \'Draft\'
                \n* If the payslip is under verification, the status is \'Waiting\'.
                \n* If the payslip is confirmed then status is set to \'Done\'.
                \n* When user cancel payslip the status is \'Rejected\'.""")
    line_ids = fields.One2many('hr.payslip.line', 'slip_id', string='Payslip Lines', readonly=True,
        states={'draft': [('readonly', False)]})
    company_id = fields.Many2one('res.company', string='Company', readonly=True, copy=False,
        default=lambda self: self.env['res.company']._company_default_get(),
        states={'draft': [('readonly', False)]})
    worked_days_line_ids = fields.One2many('hr.payslip.worked_days', 'payslip_id',
        string='Payslip Worked Days', copy=True, readonly=True,
        states={'draft': [('readonly', False)]})
    input_line_ids = fields.One2many('hr.payslip.input', 'payslip_id', string='Payslip Inputs',
        readonly=True, states={'draft': [('readonly', False)]})
    paid = fields.Boolean(string='Made Payment Order ? ', readonly=True, copy=False,
        states={'draft': [('readonly', False)]})
    note = fields.Text(string='Internal Note', readonly=True, states={'draft': [('readonly', False)]})
    contract_id = fields.Many2one('hr.contract', string='Contract', readonly=True,
        states={'draft': [('readonly', False)]})
    details_by_salary_rule_category = fields.One2many('hr.payslip.line',
        compute='_compute_details_by_salary_rule_category', string='Details by Salary Rule Category')
    credit_note = fields.Boolean(string='Credit Note', readonly=True,
        states={'draft': [('readonly', False)]},