Odoo Help


My ir.actions.server isn't being triggered on sales order save, why?

Kit Sunde
on 8/24/14, 12:36 PM 1,342 views

I'm trying to get a basic action triggered when I save the sales order. I've tried buttin print statements and even just plain exit() in the code block, but neither seem to be getting called. I've restarted the server, upgraded the module and the XML is being loaded. This is what I have:

<?xml version="1.0" encoding="utf-8"?>
        <record id="ir_actions_server_schedule_emails" model="ir.actions.server">
            <field name="state">code</field>
            <field name="model_id" ref="sale.model_sale_order"/>
            <field name="code">exit()</field>
            <field name="type">ir.actions.server</field>
            <field name="state">code</field>
            <field name="condition">True</field>
            <field name="name">Schedule Emails</field>

Why is it not triggering?


Kit Sunde
On 8/24/14, 3:08 PM

ir.actions.server just defines an action to be taken, but it doesn't inherently have any triggers for that action. To trigger ir.actions.server on a modal update add a base.action.rule record. Use something like this:

<record id="rule_trigger_email_schedule" model="base.action.rule">
  <field name="name">Trigger email scheduling.</field>
  <field name="model_id" ref="sale.model_sale_order" />
  <field name="kind">on_create_or_write</field>
  <field name="server_action_ids" eval="[(6,0,[ref('ir_actions_server_schedule_emails')])]" />

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 8/24/14, 12:36 PM
Seen: 1342 times
Last updated: 3/16/15, 8:10 AM