Skip to Content
Menu
This question has been flagged
2 Replies
5904 Views

I am trying to set up automated actions in Odoo 13 and have been able to successfully create them in the settings interface. The problem is I am working in a test environment and I would like to have the automated actions handled by git so when I push new changes to the live branch it will include new automated actions. 


I have looked at the demo in the base automations model but I haven't been able to translate that over to my actions. I am trying to set up an action with the sale.order model but I get an external ID not found error. 

Avatar
Discard
Author Best Answer

In case anyone else is having this issue, this is how I ended up solving it.


<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="AUTOMATION_ID" model="base.automation">
        <field name="name">FRIENDLY NAME</field>
        <field name="model_id" ref="sale.model_sale_order"/> <!-- This was the model I used -->
        <field name="state">code</field>
        <field name="code">
CODE GOES HERE
        </field>
        <field name="trigger">TRIGGER</field>
        <field name="active" eval="True"/>
    </record>
</odoo>

In my case it was with the model_id that I was having difficulty with and I just needed to change the id syntax to the following:

parent_model.model_submodel_name

I was using sale.order which becomes sale.model_sale_order
Avatar
Discard
Best Answer

Thanks a lot you saved my life!

Not really obvious this way to name the model_id :)

Avatar
Discard