Created
March 15, 2016 13:56
-
-
Save anonymous/21ec08e4f7b47b9a1ae8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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