Search code examples
pythonodoo

How to set a currency as active when installing a module in odoo?


I have a module where I need to use Dominican Pesos (DOP) and Dollars (USD) as currencies, but DOP is not active by Default. How can I set DOP as active when installing a module? I have try with this but that code is for adding a new currency, and what I want to do is to set the field 'active' of an existing currency as True.

<?xml version='1.0' encoding='utf-8'?>
<odoo>
  <data noupdate="1">
    <record id="74" model="res.currency">
      <field name="active">True</field>
    </record>
  </data>
</odoo>

Solution

  • You need to use the external id used in the base module.

    <record id="base.DOP" model="res.currency">
        <field name="active" eval="True"/>
    </record>