(self, sequence_date=None)
return self._create_date_range_seq(sequence_date)
Returns the object on which we can find the number_next to consider for the sequence.
        It could be an ir.sequence or an ir.sequence.date_range depending if use_date_range is checked
        or not. This function will also create the ir.sequence.date_range if none exists yet for today
Returns the object on which we can find the number_next to consider for the sequence.
        It could be an ir.sequence or an ir.sequence.date_range depending if use_date_range is checked
        or not. This function will also create the ir.sequence.date_range if none exists yet for today
Returns the object on which we can find the number_next to consider for the sequence . It could be an ir . sequence or an ir . sequence . date_range depending if use_date_range is checked or not . This function will also create the ir . sequence . date_range if none exists yet for today
def _get_current_sequence(self, sequence_date=None):
        '''Returns the object on which we can find the number_next to consider for the sequence.
        It could be an ir.sequence or an ir.sequence.date_range depending if use_date_range is checked
        or not. This function will also create the ir.sequence.date_range if none exists yet for today
        '''
        if not self.use_date_range:
            return self
        sequence_date = sequence_date or fields.Date.today()
        seq_date = self.env['ir.sequence.date_range'].search(
            [('sequence_id', '=', self.id), ('date_from', '<=', sequence_date), ('date_to', '>=', sequence_date)], limit=1)
        if seq_date:
            return seq_date[0]
        #no date_range sequence was found, we create a new one
        return self._create_date_range_seq(sequence_date)
def _get_current_sequence ( self , sequence_date = None ) : if not self . use_date_range : return self sequence_date = sequence_date or fields . Date . today ( ) seq_date = self . env [ 'ir.sequence.date_range' ] . search ( [ ( 'sequence_id' , '=' , self . id ) , ( 'date_from' , '<=' , sequence_date ) , ( 'date_to' , '>=' , sequence_date ) ] , limit = 1 ) if seq_date : return seq_date [ 0 ] #no date_range sequence was found, we create a new one return self . _create_date_range_seq ( sequence_date )