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.
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.
For professional paid support, you may contact us at