Hello all, please i have a model that needs the ID for each applicant to be generated automatically when the document is approval. I want the ID for each applicant to be generated uniquely when the form is approve. The sample fields in the model are: Applicant ID (to be generated when the form is approved), Applicant name. etc. Please how do I achieve that? Thanks
You have to use the same method as generating a unique order number. Or just use the id of the record. That should be unique anyway.
Are there any requirements for the Applicant ID (needs to be at least x long, must be in the following format: XXX-ID-(A or B), ... ) Depending on the answers of the above question, you can use the record ID, or use ir.sequences.
stockpick = self.pool.get('stock.picking').browse(.....) name = sequence_obj.get('stock.picking.%s'%(stockpick.type))
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 6/7/13, 9:48 AM|
|Seen: 1635 times|
|Last updated: 3/16/15, 8:10 AM|