**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

_name = 'hr.payslip.line'
    _inherit = 'hr.salary.rule'
    _description = 'Payslip Line'
    _order = 'contract_id, sequence'
    slip_id = fields.Many2one('hr.payslip', string='Pay Slip', required=True, ondelete='cascade')
    salary_rule_id = fields.Many2one('hr.salary.rule', string='Rule', required=True)
    employee_id = fields.Many2one('hr.employee', string='Employee', required=True)
    contract_id = fields.Many2one('hr.contract', string='Contract', required=True, index=True)
    rate = fields.Float(string='Rate (%)', digits=dp.get_precision('Payroll Rate'), default=100.0)
    amount = fields.Float(digits=dp.get_precision('Payroll'))
    quantity = fields.Float(digits=dp.get_precision('Payroll'), default=1.0)
    total = fields.Float(compute='_compute_total', string='Total', digits=dp.get_precision('Payroll'), store=True)
    @api.depends('quantity', 'amount', 'rate')
    def _compute_total(self):
        for line in self:
            line.total = float(line.quantity) * line.amount * line.rate / 100
    @api.model
    def create(self, values):
        if 'employee_id' not in values or 'contract_id' not in values:
            payslip = self.env['hr.payslip'].browse(values.get('slip_id'))
            values['employee_id'] = values.get('employee_id') or payslip.employee_id.id
            values['contract_id'] = values.get('contract_id') or payslip.contract_id and payslip.contract_id.id
            if not values['contract_id']:
                raise UserError(_('You must set a contract to create a payslip line.'))
        return super(HrPayslipLine, self).create(values)
class HrPayslipWorkedDays(models.Model):