Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2016 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/21ec08e4f7b47b9a1ae8 to your computer and use it in GitHub Desktop.
Save anonymous/21ec08e4f7b47b9a1ae8 to your computer and use it in GitHub Desktop.
from openerp import fields, models, api
class test_skip_sequence(models.Model):
_name = 'ir.sequence'
_inherit = 'ir.sequence'
@api.cr_uid
def skip_sequence(self, cr, uid, ids=None, context=None):
name = 'Sezionale Vendite'
step = 3
if context is None:
context = {}
seq_ids = self.search(cr, uid, [('name', '=', name)], context)
for seq in self.browse(cr, uid, seq_ids, context=context):
self.write(cr, uid, seq, {'number_next': seq.number_next_actual + step}, context=context)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment