Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5760 Widoki

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>

Awatar
Odrzuć
Najlepsza odpowiedź

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"/>
Awatar
Odrzuć
Autor

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.

Powiązane posty Odpowiedzi Widoki Czynność
Sequence title Rozwiązane
2
wrz 20
3737
1
lip 25
2660
1
sie 24
2036
sequence prefix. Rozwiązane
3
wrz 23
3645
0
maj 23
2357