@CZoellner is right. You must change your method. It will be something like this:
@api.model def create(self, vals): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(ClassName, self).create(vals)
He needs to refer to the case when customer_id_no is provided. Like this
@api.model def create(self, vals): if not vals.get('customer_id_no'): vals['customer_id_no'] = mechanics_to_generate_sequence() return super(ClassName, self).create(vals)
Note that after that you will need to make the next iteration sequence the next value in customer_id_no
.
source share