Odoo Automation

Automated actions are used to trigger the actions automatically. The changes are based on the actions of the user and on time conditions. These actions are used for Creating, Updating, and Deleting the record of databases in Odoo.

Automated actions are also based on Domains, which possibly define business rules. By using Python codes with automation actions we can add the functionality to Odoo without programming. 

To generate the automation action go to Automation from anywhere in odoo studio.

Automated Actions

To view or generate the automated actions go to:

Settings> Technical>Automation>Automated actions.

Generate a new automated action, click on the CREATE button.

To initiate the automated action, first, we have to define the following elements:

Model, Trigger, Apply on, and Action.

Model:  The model will be selected where the automation is applied.

Trigger:  Explain where the action can be applied. The six triggers are obtainable.

  • On Creation  When a record is created and saved this trigger action is applied. 
  • On Update When the previous record is edited and saved then this trigger action is applied. But when the record changes from one phase to another, it defines the Before Update Domain filter, which satisfies the condition of the record before updating. Then set Apply on the filter, which checks the condition of the record after updating.

  • On Creation and Update:  When the record is created and saved and edited afterward and then saved, this trigger action is applied.
  • On Deletion: When the record is deleted this trigger action is used.

Based on Time Condition

When the trigger field’s date or date and time value is reached this action is triggered.

After the trigger date, to trigger the action, add minutes numbers, hours, days, and months below the Delay after the trigger date. Add a negative number before triggering the action.

Apply On:   Explain the model of the record where the action should be applied. It also worked the same way as  we applied the filter on the model

Action:   It determines what the automated actions do. There are eight types of automated actions to choose from.

  1. Executing the Python Code:  This action is used for the execution of the Python code. The accessible variables are mentioned on the Python Code tab, which is used for writing code on the Help tab.
  • To agree with the action, tick the Available on the Website and add a Website Path to run through the website.
  1. Create New Record: This action is used for creating a new model or any record. 
  • Select the field below the Link field, to link the record that triggers the new creation of the record. For example, we can create the contact automatically when the lead turns into an opportunity.
  •  Data to write tab: This is used to determine the new record’s values. After selecting a discipline, pick out its Evaluation type.
  • Value: Directly used to give the value of the field’s raw in the Value column. 
  • Reference: Used for selecting the record under the Record column and allowing the Studio to add the internal ID to the Value column.
  • Python Expression: Used to dynamically define the newly created file’s value for a subject with the usage of Python code within the Value column.
  1. Update the Record: This is used to set the values of the field record on the current model.
  2. Execution of Several Actions:  Multiple actions can be triggered at once. Under the Actions tab, click on the Add a line pop-up of  Child Action, click on Create, and then configure the action.
  3. Sending Email:  Send an email to contacts linked with the specific records. To perform, select and create an Email Template. 
  4.  Add Followers: Subscribe existing contacts to the record, to use this action.
  5. Create Next Activity: Used to link a new activity to the record. Activity tab is used to set it up, but alternatively the Assigned to field, an Activity user type can be selected. The Specific User selected and under Responsibility add the users if the activity assigned to the user. The user linked to the record to target dynamically, select the Generic User From Record, and change the User field name if mandatory.
  1. Send Text Message: To do so, select the SMS Template and link the contact of the record.

Leave a Comment

Your email address will not be published. Required fields are marked *