Book Image

Odoo 11 Development Cookbook - Second Edition

Book Image

Odoo 11 Development Cookbook - Second Edition

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source are 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. Version 11 offers better usability and speed: a new design (as compared to the current Odoo Enterprise version) and a mobile interface. The book starts by covering Odoo installation and administration and Odoo Server deployment. It then delves into the implementation of Odoo modules, the different inheritance models available in Odoo. You will then learn how to define access rules for your data; how to make your application available in different languages; how to expose your data models to end users on the back end and on the front end; and how to create beautiful PDF versions of your data. By the end of the book, you will have a thorough knowledge of Odoo and will be able to build effective applications by applying Odoo development best practices
Table of Contents (18 chapters)

Activating the Odoo developer tools

When using Odoo as a developer, you need to know how to activate Developer Mode in the web interface to access the advanced settings menu and developer information.

How to do it...

To activate Developer Mode in the web interface, do as follows:

  1. Connect to your instance and authenticate as admin
  2. Go to the Settings menu
  3. Locate the Share the love card, which should be on the right of the screen:
  4. Click on the Activate the developer mode link
  1. Wait for the UI to reload
It is also possible to activate the developer mode by editing the URL; before the # sign, insert ?debug. For instance, if you are starting from
http://localhost:8069/web#menu_id=102&action=94, then you need to change this to
http://localhost:8069/web?debug=#menu_id=102&action=94.
To exit the developer mode, you can do either of these:
  • Edit the URL and remove that string
  • Close your browser tab and open a new one
  • Use the Deactivate the developer mode link displayed in the Share the love card when the Developer mode is active

How it works...

When in developer mode, two things happen:

  1. You get tooltips when hovering over a field in a form view or over a column in list view, providing technical information about the field (internal name, type, and so on)
  2. A drop-down menu with a Bug icon is displayed next to the user's menu in the top-right corner, giving access to technical information about the model being displayed, the various related view definitions, the workflow, custom filter management, and so on

There is a variant of the developer mode—the Developer mode (with assets). This mode behaves as the normal developer mode, but additionally, the JavaScript and CSS code sent to the browser is not minified, which means that the web development tools of your browser are easy to use for debugging the JavaScript code (more on this in Chapter 15, Web Client Development).

Caution!

Test your addons both with and without developer mode, as the unminified versions of the JavaScript libraries can hide bugs that only bite you in the minified version.