Odoo Help

Welcome!

This community 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.

0

How to create sequence on OpenERP 6.1?

By
Dave Pang
on 7/25/13, 1:21 PM 2,498 views

I want to create an opportunity number with auto sequence.

I already created a new field x_opp_num. How can I create a new sequence code ? Thanks.

0

Hiral Patel (hip)

--Hiral Patel (hip)--
Tiny ERP Pvt Ltd
http://www.odoo.com
913
| 2 1 5
India
--Hiral Patel (hip)--


Hiral Patel (hip)
On 7/26/13, 8:59 AM

In xml file write :

<record id="seq_type_1" model="ir.sequence.type"> <field name="name">Test Type</field> <field name="code">test</field> </record> <record id="seq_1" model="ir.sequence"> <field name="name">Test</field> <field name="code">test</field> <field name="prefix">test</field> <field name="padding">3</field> </record>

In .py file all default in object where you want to add sequence :

_defaults = { 'x_opp_num': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'test'), }

In default 'test' is same name as code in xml.

Want to create a sequence for an existing field - Payment Ref (under Customer Invoices). Copied above code to account_voucher_sequence.xml, however, cant see new entry under Settings>Configuration>Sequence&Identifiers>Sequences

Also tried renaming 'name' and 'code' of Purchase Entry in the same XML file, however, unable to see any changes under Settings>Configuration>Sequence&Identifiers>Sequences

Please let me know where m i going wrong. thanks!

Bhavik
on 9/9/13, 12:32 AM

Have you updated the database with changed module?

Hiral Patel (hip)
on 9/12/13, 5:07 AM

i m afraid i dont know how to update db with changed module, could you please help me. thanks.

Bhavik
on 9/14/13, 1:09 AM

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 7/25/13, 1:21 PM
Seen: 2498 times
Last updated: 3/16/15, 8:10 AM