Automated actions in Odoo 17 enable users to set predefined actions triggered automatically by specified conditions or events. These actions include sending emails, creating records, updating fields, and triggering notifications. By automating repetitive tasks, businesses enhance efficiency, accuracy, and productivity.
Automated Actions and Server Actions in Odoo offer a potent way to extend functionality without extensive coding. Even in Odoo Online, where development is limited, automated actions remain accessible, empowering users to optimize workflows effectively.
There are several ways in which Odoo's functionality can be enhanced and customized through automated actions:
1. Streamlined Workflow: Automatically adjust a document's "stage" based on predefined rules, simplifying and streamlining your business processes.
2. Validation Mechanisms: Implement validation checks to prevent users from manually altering the "stage" inappropriately, ensuring data integrity and adherence to business rules.
3. Task Automation: Automatically generate follow-up tasks for users based on specific triggers or events, facilitating task management and ensuring that critical actions are not overlooked.
To simplify data entry and minimize errors, automate the assignment of field values based on predefined rules. Implement validation checks to prevent users from entering incorrect data, such as avoiding the creation of duplicate products.
Automated actions can be triggered upon the creation, deletion, or update of records within a specified Odoo Model (database table). These actions may also be triggered by form modifications or time-based conditions. Business rules can be defined using domains and "watched fields" (actions specific to certain customer groups or product types), and more complex logic can be implemented using Python code.
To configure automated actions, start by enabling developer mode and navigating to Settings -> Technical -> Automated Actions. From there, you can define the rules and conditions that trigger automated actions to streamline your workflow and improve data accuracy.
Installation
If you are unable to locate this option, you may need to install the Automatic Action Rules module. To do so, begin by removing the "Apps" filter. Simply click on the 'X' icon next to it.
Schedulers are automated processes that execute at predefined intervals without requiring manual intervention. They perform various tasks in the background, simplifying the execution of background jobs. To schedule a task, simply insert a record into it. cron table and Odoo will execute it according to the defined schedule.
To configure an automated action with trigger conditions and domains in Odoo 17, follow these steps:
Model
Specify the model where the automated action will be applied.
Triggers
1. Upon Creation: This trigger initiates the action when a new record is created and subsequently saved.
2. Upon Update: This trigger activates the action when a previously saved record is modified and then saved.
3. Upon Creation & Update: This trigger initiates the action upon the creation and subsequent saving or editing and saving of a record.
4. Upon Deletion: This trigger activates the action upon the deletion of a record.
5. Based on Form Modification: The action is triggered when any change is made to a trigger field's value on the Form view, even before saving the record. This trigger only functions on the user interface when a modification is made by a user. If the field is altered through another action and not by the user, the action will not run.
6. Based on Timed Condition: The action is initiated when the date or date & time value of a trigger field reaches a specific point in time. To activate the action after the Trigger Date, specify a duration in minutes, hours, days, or months under Delay after the trigger date. Alternatively, to trigger the action before the specified date, input a negative duration.
Apply on:
Specify the criteria for applying the automated action to records within the model, to apply filters on a model.
Action:
Define the desired automated action (server action). There are eight types of actions available:
Execute Python Code: This action executes Python code. The available variables are detailed on the Python Code tab, where you can also write your code, or on the Help tab.
To enable the action to be executed via the website, check the box for Available on the Website and provide a Website Path.
Create a new Record: This action is used to create a new record within any model.
Update the Record: This action is used to assign value(s) to the field(s) of any record within the current model.
Execute several actions: This action is employed to trigger multiple actions simultaneously. To do so, click on "Add a line" under the Actions tab. In the Child Actions pop-up, select "Create and configure the action."
Send Email: This action is used to send an email to a contact associated with a specific record. To achieve this, either select an existing Email Template or create a new one.
Add Followers: This action is utilized to subscribe existing contacts to the record.
Create Next Activity: This action is employed to schedule a new activity linked to the record. Utilize the Activity tab to set it up as usual. Instead of the "Assigned to" field, choose an Activity User Type. Opt for "Specific User" and specify the user under "Responsible" if the activity should consistently be assigned to the same user. To dynamically target a user associated with the record, select "Generic User From Record" and adjust the User field name if necessary.
Sending SMS Text Message: This action is utilized to dispatch an SMS to a contact associated with the record. To accomplish this, choose an existing SMS Template or create a new one.
To link the record that initiated the creation of the new record, choose a field under Link Field. For instance, you could automatically generate a contact when a lead is converted into an opportunity.
Allowed Groups: Groups that can execute the server actions
Action Details: Define the result of automated action when the condition is satisfied.
In conclusion, automated actions within Odoo 17 serve as a potent means to enhance the software's capabilities effortlessly, sans the need for coding. By leveraging automated actions, one can seamlessly initiate predefined actions based on time parameters or specified criteria, simplifying the execution of background tasks. Furthermore, schedulers enable the automation of tasks over designated timeframes, eliminating the need for manual intervention.