Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5761 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

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.

Post Terkait Replies Tampilan Aktivitas
Sequence title Diselesaikan
2
Sep 20
3737
1
Jul 25
2660
1
Agu 24
2036
sequence prefix. Diselesaikan
3
Sep 23
3645
0
Mei 23
2357