Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
5290 Vistas

Hello!

I've been trying for a few days the way to install a custom module I've done with a base.automation record, but I'm always having a ParseError failing the installation. The xml code (only the part related with the automated action) is the following one:

<record model="ir.actions.server" id="esdeveniments_updateDeadline">

<field name="name">Update Deadline</field>

<field name="model_id" ref="esdeveniments.model_esdeveniments"/>

<field name="sequence">1</field>

<field name="type">ir.actions.server</field>

<field name="code">

                if records: 

                   action = records.updateDeadline()

</field>

</record> 

 

<record model="base.automation" id="rule_esdeveniments_updateDeadline">

<field name="name">TriggerUpdateDeadline</field>

<field name="model_id" ref="esdeveniments.model_esdeveniments"/>

<field name="active">1</field>

<field name="trigger" ref="on_create"/>

<field name="action_server_id" ref="esdeveniments_updateDeadline"/>

</record>

Furthermore, I installed the automation module and I can create automated actons by the Odoo aplication itself. As I can understand, it seems that Odoo doesn't recognize or doesn't find the base.automation module, but I don't know why (I've checked that the module is also on the PostgreSQL database). Does anyone know what is happening or how could I solve this error? The version of Odoo is Odoo 11.0-20181026 (Versión Community).

The error message (the last call) is this one:

odoo.tools.convert.ParseError: "base.automation" while parsing /moduls_nous/esdeveniments/esdeveniments.xml:89, near

<record model="base.automation" id="rule_esdeveniments_updateDeadline">

<field name="name">TriggerUpdateDeadline</field>

<field name="model_id" ref="esdeveniments.model_esdeveniments"/>

<field name="active">1</field>

<field name="trigger" ref="on_create"/>

<field name="action_server_id" ref="esdeveniments_updateDeadline"/>

</record>

Many thanks in advance!

Avatar
Descartar
Mejor respuesta

What is the depends statement of your module manifest telling Odoo about which other modules you are going to reference in your Python and XML?

Does it include base_automation ?

If not, Odoo won't be able to find the base.automation model that you want to add a record to, because you aren't telling it you will need that module or any of the models included in it.

Avatar
Descartar
Autor Mejor respuesta

Hello!

That was the problem! I didn't know I had to specify that dependency...

Many thanks Ray!

Avatar
Descartar