Odoo Help

0

Ongoing customer ID in openERP 7

By
cdn
on 3/25/13, 3:57 PM 5,146 views

Is there a way to automatically set ongoing customer ID's in openERP v.7?

please explain what you mean by an "ongoing customer ID"

Martin
on 3/25/13, 7:18 PM

OK. I would like to set a start value for my customers ID, like 00121. The first customer get this ID, the second 00122 (auto increment).

BTW: I'm new at openerp, is there a manual or sth. like that? I'm not a programmer as well and the backend looks very complicated..

cdn
on 3/26/13, 3:36 AM

you can use sequence.

Sudhir Arya (SA)
on 3/26/13, 3:39 AM
3
Sudhir Arya (SA)
On 3/26/13, 3:44 AM

You can use sequence.

Add sequence in sequence.xml file.

<record model="ir.sequence.type" id="seq_type_emp_id">
    <field name="name">Employee Number</field>
    <field name="code">hr.employee</field>
</record>
<record model="ir.sequence" id="seq_emp_id">
    <field name="name">Employee Number</field>
    <field name="code">hr.employee</field>
    <field name="prefix"></field>
    <field name="padding">3</field>
</record>

After that you can call the sequence:

my_sequence = self.pool['ir.sequence'].get(cr, uid, seq_obj_name)
self.write(cr, uid, [picking.id], {'ur_emp_no_field': my_sequence})

You can call this sequence either from create, your own function, write or from _defaults.

Thank you for your reply. I already told that I am new at openerp. So where I can insert this sequence.xml and also call it? EDIT: This sequence looks like Employee ID's, I have to modify it right? Thanks!

cdn
on 3/26/13, 4:04 AM

Yes, you have to modify as per your requirement. Create sequence.xml and put it in __openerp__.py same as you add your other xml files.

Sudhir Arya (SA)
on 3/26/13, 4:18 AM

I'm new at openerp. This will be the first time to add a new sequence :D Is there a manual or sth. like that? I start without any foreknowledge..

cdn
on 3/26/13, 6:13 AM
2

Hi cdn,

Yes, there is a way to set automatically customer ID's in openERP v7.

For that you have to create sequence.

Setting/Sequences & Identifiers/Sequences.

Thank You.

(SerpentCS Pvt. Ltd.)

Is there any code required to use the Sequence for Customers?

Travelping GmbH, Holger Winkelmann
on 6/27/13, 7:11 PM

I would like to know the rest of that conversation. Thanks.

René Arbour
on 8/7/13, 11:12 PM
0
cdn
On 3/26/13, 3:35 AM

OK. I would like to set a start value for my customers ID, like 00121. The first customer get this ID, the second 00122 (auto increment).

BTW: I'm new at openerp, is there a manual or sth. like that? I'm not a programmer as well and the backend looks very complicated..

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

Question tools

2 follower(s)

Stats

Asked: 3/25/13, 3:57 PM
Seen: 5146 times
Last updated: 3/16/15, 8:10 AM