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

Creating server actions


Server actions underpin the Odoo automation tools. They allow us to describe the actions to perform. These actions are then available to be called by event triggers, or to be triggered automatically when certain time conditions are met.

The simplest case is to let the end user perform some action on a document by selecting it from the More button menu. We will create such an action for project tasks, to Set as Priority by starring the currently selected task and setting a deadline on it to three days from now.

Getting ready

We will need an Odoo instance with the Project app installed. We will also need the Developer Mode activated. If it's not, activate it in the Odoo About dialog.

How to do it...

To create a server action and use it from the More menu, follow these steps:

  1. 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 these values:

    • Action...