Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
what is the code for auto increment in openerp-7.0?? can anyone give me sample code. something like mrp or manufacturing module? Manufacturing Order MO/00077. Please help me
It is called sequences in odoo/openerp world :)
first check that your user has enabled Technical features under user's acces rights
check Setting -> Technical -> Sequences & identifiers -> Sequences
----> here you can find and modify all defined sequences on current database
as for coded example...
1. create your own module, models and views in it.
2. in xml file create a custom sequence like:
<record id="some_sequence_type_id" model="ir.sequence.type">
<field name="name">Name of Sequence Type</field>
<record id="some_sequence_id" model="ir.sequence">
<field name="name">Name of Sequence</field>
<field name="padding">5</field> <!-- number of zeroes when starting from 1 -.>
<field name="company_id" eval="False"/>
3. from your code you can get next seq nubmer like:
... seq_no = self.pool.get('ir.sequence').get(cr, uid, 'SEQ-CODE')
does it help now?
take a look at create methods in sale, stock invoice models... there name is fetched in simmilar way...
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/16/14, 9:23 AM|
|Seen: 3543 times|
|Last updated: 3/28/15, 3:13 AM|