Using Python code server actions
Server actions have several types available, but executing arbitrary Python code is the most flexible option. When used wisely, it empowers users with the capability to implement advanced business rules from the user interface, without the need to create specific add-on modules to install that code.
We will demonstrate using this type of server action by implementing a server action that sends reminder notifications to the followers of a project task.
Getting ready
We will need an Odoo instance with the Project app installed.
How to do it...
To create a Python code server action, follow these steps:
- Create a new server action. In the Settings menu, select the Technical | Actions | Server Actions menu item, and click on the Create button at the top of the record list.
- Fill out the Server Action form with the following values:
- Action Name: Send Reminder
- Base Model: Task
- Action To Do: Execute Code
- In the Python Code text area...