Using Python code server actions
Server actions have several types available, but executing arbitrary Python code is surely the most flexible one. Used wisely, it can provide power users with the capability to implement advanced business rules from the user interface, without the need to create specific addon modules to install that code.
We will demonstrate using this type of server actions by implementing one 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 and try a Python code server action, follow these steps:
- Create a new server action: on the
Settings
top menu, select theTechnical
|Actions
|Server Actions
menu item, and click on theCreate
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 Python Code
- In the
Python code
text area, remove the default text and...