Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
5830 Prikazi

I am starting to develop a new module and created the corresponding sequence for each record. But I need to create separate sequences for the module for each company created. Currently only one sequence is created and for the main company. The following is the code:
XML

<data noupdate="1">
        <record id="sequence_letter" model="ir.sequence">
            <field name="name">Cite</field>
            <field name="code">letter.sequence</field>
            <field name="prefix">CITE.:</field>
            <field name="suffix">/%(y)s</field>
            <field name="padding">4</field>
            <field name="number_next">1</field>
            <field name="number_increment">1</field>
        </record>
    </data>

Avatar
Opusti
Best Answer

Try adding the following in your record definition. However, for this you will need to create the company through the module code to be able to reference the same external id.

<field name="company_id" ref="EXTERNAL_ID_OF_THE_COMPANY"/>

for example,

<field name="company_id" ref="base.main_company"/>
Avatar
Opusti
Avtor

Hello Paresh.

This shape would create an individual sequence for a company. By default the sequences are created for the main company. In this case I would like a form of sequencing for each company created and to be created.

Hi Franklin: I'm sorry, I didn't understand your comment. Please could you explain it differently.

Related Posts Odgovori Prikazi Aktivnost
2
sep. 20
3792
1
jul. 25
2763
1
avg. 24
2154
3
sep. 23
3731
0
maj 23
2428