跳至内容
菜单
此问题已终结
1 回复
8458 查看

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?

形象
丢弃
最佳答案

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.

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

编写者

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

update ans check it

编写者

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

hi send your module code

Got soultion ?

相关帖文 回复 查看 活动
6
4月 25
17517
4
6月 24
6873
2
12月 23
2572
1
10月 23
1648
2
1月 20
2909