We used cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. What For?

« Back to Blogs

Automated actions in Odoo

Automated actions can be used to automatically trigger actions based on some conditions. We can use them to automatically perform some operations on records that meet certain criteria or based on time condition. Here, in this blog we will cover two types of actions:

 

1. Automated actions based on time conditions

 

This type of action is basically used when you want to send some notifications to someone when some time criteria is satisfied. For example, every project has a deadline and developers should be notified to complete their tasks on time. Considering this example, we will send a notification as a reminder to developer to complete their tasks on time. To run this scenario, just follow below mentioned steps:

 

Step 1: Activate Developer mode.


Step 2: Go to menu Settings > Technical > Automation > Automated Actions. Click on ‘Create’ button to create new one.


Step 3:  Fill out the form with the details as per following screenshot:

Setup Project Deadline Notifications

  • Related Document Model: Name of the model.

  • When to Run: As we want to send mail based on the time condition, select ‘Based on Time Condition’ option.

  • Filter: This field is used to specify conditions before executing the action. If the condition satisfies then the action is executed for the particular record. We will ensure that before executing action for the project’s tasks, we should check that if project task has particular deadline or not. Select dropdown field of ‘Set Selection based on as search filter’ and click on ‘Create and Edit’ option:


Create FIlter in Odoo

 

  • Trigger Date: Select ‘Deadline’ as we want to send the mail based on the Project deadline field.

  • Delay After Trigger Date: The event will be triggered after the specified delay based on the value of ‘Trigger Date’ field. You will have to set a negative value if you want to generate event before ‘Trigger Date’. Here we will send mail before 7 days, so configure -7 days for it.


  • Now, we have to set server actions to send mail. Go to ‘Actions’ tab and add a new item with the help of following screenshot.

 

Set Reminder

 

  • Save this record, Now to test it create a new task in the project and set a deadline. Before 7 days of the deadline mail will be sent to the users which are configured in the Email template.


2. Automated actions on event conditions


This option is used to trigger an action when a specific event is generated in Odoo. To understand this, we are taking an example of the Project state. Project state can be updated if the logged in user is having access rights of project manager.


  • To implement this, configuration described in below screenshots can be taken into consideration. Here I have selected “On Update” in “When to Run” field, so the action will be triggered on the updation of the record.


Perform Automated Actions on Event Conditions


  • Here is the screenshot of server action in which python code is written to display warning message to the user if he/she is not allowed to do that:

 

Display Warning in Validating Project State


  • When the Project state will be updated by any other user instead of the Project manager, following message will be appeared. Please note that “Project Manager” field will be visible after activating developer mode.


Odoo Warning for Porject Stage Validation

 
contact-us Request a callback WhatsApp