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
Settingstop menu, select theTechnical|Actions|Server Actionsmenu item, and click on theCreatebutton at the top of the record list. - Fill out the
Server Actionform with the following values:Action Name:Send ReminderBase Model:TaskAction To Do:Execute Python Code
- In the
Python codetext area, remove the default text and...