« Back

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:

  • 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:


 

  • 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.

 

 

  • 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.



  • 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:

 


  • 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.


 
Comments

Get In Touch

Contact Us

Loading

Get in touch

Headquarter : 302, Landmark, Nr. Titanium City Center, Prahlad Nagar Road, Ahmedabad, India - 380015.

Showing 1 - 5 of 20 results.
of 4
contact-us Request a callback