Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. Create a new server action: On the Settings top menu, select the Technical | Actions | Server Actions menu item, and click on the Create button at the top of the record list.

  2. Fill out the Server Action form with the following values:

    • Action Name: Send Reminder

    • Base Model: Task

    • Action To Do: Execute Python Code

  3. In the Python code text area, remove the default text...