[Python] Automatic creation of records using Odoo Code

Discussão em 'Python' iniciado por Stack, Maio 5, 2025.

  1. Stack

    Stack Membro Participativo

    I have this code that runs when I install my module and creates the registry inside Odoo, it works fine for a single company environment.

    <?xml version="1.0" encoding="UTF-8"?>
    <odoo>
    <data noupdate="1">
    <record model="account.journal" id="special_invoices_journal">
    <field name="name">FACTURAS ESPECIALES</field>
    <field name="type">purchase</field>
    <field name="refund_sequence">1</field>
    <field name="code">FESP</field>
    <field name="facturas_especiales">1</field>
    <field name="facturacion_activa">1</field>
    </record>
    </data>
    </odoo>


    But when I work in a multi-company environment, it doesn't work so well anymore, because the registry is not created in the second company. How can I make this kind of record to be created again for each new company I create in odoo?

    Continue reading...

Compartilhe esta Página