Book Image

Odoo 12 Development Essentials - Fourth Edition

By : Daniel Reis
Book Image

Odoo 12 Development Essentials - Fourth Edition

By: Daniel Reis

Overview of this book

Odoo is one of the best platforms for open source ERP and CRM. Its latest version, Odoo 12, brings with it new features and updates in Python packages to develop more customizable applications with additional cloud capabilities. The book begins by covering the development essentials for building business applications. You will start your journey by learning how to install and configure Odoo, and then transition from having no specific knowledge of Odoo to being ready for application development. You will develop your first Odoo application and understand topics such as models and views. Odoo 12 Development Essentials will also guide you in using server APIs to add business logic, helping you lay a solid foundation for advanced topics. As you progress through the chapters, you will be equipped to build and customize your applications and explore the new features in Odoo 12, such as cloud integration, to scale your business applications. You will get insights into building business logic and integrating various APIs into your application. By the end of the book, you will be able to build a business application from scratch by using the latest version of Odoo.
Table of Contents (22 chapters)
Title Page
Packt Upsell
Foreword
Contributors
Preface
Index

Window Actions


A Window Action gives instructions to the GUI client and is usually used by menu items or buttons in views. It tells the GUI which model to work on and which views to make available. These actions can filter the records to be available, using a domain filter, and can set default values and filters through the context attribute.

Window Actions are stored in the ir.actions.act_window model and can be browsed via the Settings |Technical | Actions | Window Actions menu.

In library_checkout/views/library_menu.xml, we can find the Window Action used in the checkout menu item. We need to make a change to it to enable the additional view types we'll add in this chapter:

    <act_window id="action_library_checkout"
      name="Checkouts"
      res_model="library.checkout"
 view_mode="tree,form,activity,calendar,graph,pivot"
    />

Window Actions are usually created using the <act_window> shortcut, used previously. We're changing view_mode from "tree, form" to the larger "tree...