Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
5756 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
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.

Related Posts Odpovědi Zobrazení Aktivita
Sequence title Vyřešeno
2
zář 20
3731
1
čvc 25
2656
1
srp 24
2033
3
zář 23
3639
0
kvě 23
2352