'Return number from ir_sequence row when no_gap implementation,
and number from postgres sequence when standard implementation.'

def _get_number_next_actual(self):

    for seq in self:
        if (seq.sequence_id.implementation != 'standard'):
            seq.number_next_actual = seq.number_next
        else:
            self._cr.execute(('SELECT    last_value,    increment_by,    is_called    FROM    ir_sequence_%03d_%03d' % (seq.sequence_id.id, seq.id)))
            (last_value, increment_by, is_called) = self._cr.fetchone()
            if is_called:
                seq.number_next_actual = (last_value + increment_by)
            else:
                seq.number_next_actual = last_value
