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

generating reference number

By
sneha antony
on 4/4/14, 10:28 AM 1,153 views

I have developed a new module in openerp to enter the warranty details of the customer.Each entry made is displayed in the tree view.I want to set a unique no.in a predefined format to each of the entry.Now the entries are generated with numbers 25,26,29,25,28,26 like that.I want some recognizable number so that I can easily identify each entry when used in reference fields.How can this be done?Any ideas?

0

Jagdish Panchal

--Jagdish Panchal--
2674
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 4/4/14, 10:50 AM

Hi,

Create sequence for your object Go Settings >> Sequences & Identifiers >> Sequences

Add new file yourfilename_sequence.xml in your module pase this code ans change as per your requirement, add in __opnerp__.py update module

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">

        <!-- Sequences for sale.order -->
        <record id="seq_type_sale_order" model="ir.sequence.type">
            <field name="name">Sales Order</field>
            <field name="code">sale.order</field>
        </record>

        <record id="seq_sale_order" model="ir.sequence">
            <field name="name">Sales Order</field>
            <field name="code">sale.order</field>
            <field name="prefix">SO</field>
            <field name="padding">3</field>
            <field name="company_id" eval="False"/>
        </record>

    </data>
</openerp>

Thanks

Thanks for the suggesion.But how can the reference number sequence for the specified module be created in the Settings >> Sequences & Identifiers >> Sequences.There is nothing in the Settings >> Sequences & Identifiers >> Sequences that can identify that the sequence created is for the specific module.

sneha antony
on 4/5/14, 3:37 AM

You can create sequence from Settings >> Sequences & Identifiers >> Sequences Create new record for your object. its work for you

Jagdish Panchal
on 4/5/14, 3:45 AM

Bt the object is not specified anywhere in the new record created.Then how it can be specified ?

sneha antony
on 4/5/14, 4:16 AM

update ans check it

Jagdish Panchal
on 4/5/14, 4:35 AM

An xml file with the above code has to be createdand the whole module has to be updated isnt it?

sneha antony
on 4/5/14, 4:39 AM

hi send your module code

Muthumani
on 4/7/14, 3:51 AM

Got soultion ?

Jagdish Panchal
on 5/8/14, 2:29 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

0 follower(s)

Stats

Asked: 4/4/14, 10:28 AM
Seen: 1153 times
Last updated: 3/16/15, 8:10 AM