Answers for "how to make a custom sequence in odoo with condition"

0

how to make a custom sequence in odoo with condition

def create(self, cr, uid, vals, context=None):
        if vals.get('chalan')=='Chalan':
             if vals.get('chalan_number','/')=='/':
                 vals['chalan_number'] = self.pool.get('ir.sequence').get(cr, uid, 'your_sequence_name') or '/'     
             return super(your_class_name,self).create(cr, uid, vals, context=context)
Posted by: Guest on April-07-2022

Code answers related to "how to make a custom sequence in odoo with condition"

Browse Popular Code Answers by Language