Ejemplo n.º 1
0
 def _next(self):
     if self.sequence_id.implementation == 'standard':
         number_next = ir_sequence._select_nextval(self._cr, 'ir_sequence_%03d_%03d' % (self.sequence_id.id, self.id))
     else:
         number_next = ir_sequence._update_nogap(self, self.sequence_id.number_increment)
         
     return self.sequence_id.get_next_char(number_next, self.prefix, self.suffix)
Ejemplo n.º 2
0
 def _next_do(self):
     if self.env.context.get('sequence_tuple', False):
         if self.implementation == 'standard':
             number_next = _select_nextval(self._cr,
                                           'ir_sequence_%03d' % self.id)[0]
         else:
             number_next = _update_nogap(self, self.number_increment)
         prefix, suffix = self._get_prefix_suffix()
         return (prefix, number_next, suffix,
                 self.get_next_char(number_next))
     return super()._next_do()
Ejemplo n.º 3
0
 def _next_do(self):
     if self.env.context.get("sequence_tuple", False):
         if self.implementation == "standard":
             number_next = _select_nextval(self._cr,
                                           "ir_sequence_%03d" % self.id)[0]
         else:
             number_next = _update_nogap(self, self.number_increment)
         prefix, suffix = self._get_prefix_suffix()
         code = self.get_next_char(number_next)
         dc = ""
         formula = self.check_digit_formula
         if formula and formula != "none":
             dc = code[-1:]
         return (prefix, number_next, suffix, dc, code)
     return super()._next_do()
Ejemplo n.º 4
0
 def _next(self):
     if self.env.context.get('sequence_tuple', False):
         if self.sequence_id.implementation == 'standard':
             number_next = _select_nextval(
                 self._cr, 'ir_sequence_%03d_%03d' % (
                     self.sequence_id.id, self.id))[0]
         else:
             number_next = _update_nogap(
                 self, self.sequence_id.number_increment)
         prefix, suffix = self.sequence_id._get_prefix_suffix()
         code = self.sequence_id.get_next_char(number_next)
         dc = ''
         formula = self.sequence_id.check_digit_formula
         if formula and formula != 'none':
             dc = code[-1:]
         return (
             prefix, number_next, suffix, dc, code)
     return super()._next()
Ejemplo n.º 5
0
 def get_next_number(self):
     self.ensure_one()
     return _update_nogap(self, 1)
Ejemplo n.º 6
0
 def _next(self):
     number_next = _update_nogap(self, 1)
     return self.sequence_id.get_next_char(number_next)