Impacted versions: 10.0/11.0

Steps to reproduce: go to [http://281537-11-0-12c7d3.runbot8.odoo.com](http://281537-11-0-12c7d3.runbot8.odoo.com/web?debug=1?#id=12&view_type=form&model=ir.sequence&menu_id=38&action=22) --> Settings --> Sequences --> 'Account reconcile sequence'

Current behavior: Traceback during Saving record

![](https://image.prntscr.com/image/G4x_oq6xQr2HduZQiUPDdA.png)

Change Implementation to Standard and Save the record.

![](https://image.prntscr.com/image/cv0b3Pq9SzW0Dya-zZ4cyA.png)
Expected behavior: Should Save the record

Video/Screenshot link (optional): 


if self.sequence_id.implementation == 'standard':
            number_next = _select_nextval(self.env.cr, 'ir_sequence_%03d_%03d' % (self.sequence_id.id, self.id))
        else:
            number_next = _update_nogap(self, self.sequence_id.number_increment)
        return self.sequence_id.get_next_char(number_next)
    @api.multi
    def _alter_sequence(self, number_increment=None, number_next=None):
        for seq in self:
            _alter_sequence(self.env.cr, "ir_sequence_%03d_%03d" % (seq.sequence_id.id, seq.id), number_increment=number_increment, number_next=number_next)
    @api.model
    def create(self, values):
        """ Create a sequence, in implementation == standard a fast gaps-allowed PostgreSQL sequence is used.
        """
        seq = super(ir_sequence_date_range, self).create(values)
        main_seq = seq.sequence_id
        if main_seq.implementation == 'standard':
            _create_sequence(self.env.cr, "ir_sequence_%03d_%03d" % (main_seq.id, seq.id), main_seq.number_increment, values.get('number_next_actual', 1))
        return seq
    @api.multi
    def unlink(self):
        _drop_sequence(self.env.cr, ["ir_sequence_%03d_%03d" % (x.sequence_id.id, x.id) for x in self])
        return super(ir_sequence_date_range, self).unlink()
    @api.multi
    def write(self, values):
        if values.get('number_next'):
            seq_to_alter = self.filtered(lambda seq: seq.sequence_id.implementation == 'standard')
            seq_to_alter._alter_sequence(number_next=values.get('number_next'))
        return super(ir_sequence_date_range, self).write(values)