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

Ongoing customer ID in openERP 7

By
cdn
on 3/25/13, 3:57 PM 4,193 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)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

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

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 3/26/13, 3:46 AM

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

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: 3/25/13, 3:57 PM
Seen: 4193 times
Last updated: 3/16/15, 8:10 AM