Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Odoo 15 Development Essentials

You're reading from   Odoo 15 Development Essentials Enhance your Odoo development skills to create powerful business applications

Arrow left icon
Product type Paperback
Published in Feb 2022
Publisher Packt
ISBN-13 9781800200067
Length 548 pages
Edition 5th Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Daniel Reis Daniel Reis
Author Profile Icon Daniel Reis
Daniel Reis
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Section 1: Introduction to Odoo Development
2. Chapter 1: Quick Start Using the Developer Mode FREE CHAPTER 3. Chapter 2: Preparing the Development Environment 4. Chapter 3: Your First Odoo Application 5. Chapter 4: Extending Modules 6. Section 2: Models
7. Chapter 5: Importing, Exporting, and Module Data 8. Chapter 6: Models – Structuring the Application Data 9. Section 3: Business Logic
10. Chapter 7: Recordsets – Working with Model Data 11. Chapter 8: Business Logic – Supporting Business Processes 12. Chapter 9: External API – Integrating with Other Systems 13. Section 4: Views
14. Chapter 10: Backend Views – Designing the User Interface 15. Chapter 11: Kanban Views and Client-Side QWeb 16. Chapter 12: Creating Printable PDF Reports with Server-Side QWeb 17. Chapter 13: Creating Web and Portal Frontend Features 18. Section 5: Deployment and Maintenance
19. Chapter 14: Understanding Odoo Built-In Models 20. Chapter 15: Deploying and Maintaining Production Instances 21. Other Books You May Enjoy

Enabling the developer tools

The Odoo developer tools are needed for us to implement our project. They are made available by enabling the developer mode.

The developer mode is useful for inspecting and modifying the current Odoo configurations. It allows us to customize Odoo apps directly from the UI and is a quick way to make changes and add features. It can be used for making small modifications, such as adding a custom field, or it can be used for larger customizations, such as creating an application with its own menus, views, and underlying data model.

Caution

The developer mode exposes internal configurations for Odoo apps and allows them to be changed. With great power comes great responsibility, so be careful with the changes made. Always try these changes on a copy database before making them in a live system. If things go wrong, there is a chance that an upgrade of the affected app – or the base module – can resolve the issues, but this is not guaranteed.

Making customizations through the developer tools has some limitations compared to the programming tools covered throughout the rest of the book. For example, the developer tools can't add or extend the default ORM methods.

The customizations made with the developer mode (and with the Odoo Studio app, for that matter) can't be easily integrated into a structured development workflow with version control, automated tests, and QA/staging/production code promotion workflows.

The developer mode features will be used in this chapter as a way to introduce how the application configuration data is organized in the Odoo framework and how the developer mode can be leveraged for simple customizations or prototyping solutions.

Enabling the developer mode

For Odoo 13 and later, the developer mode is enabled on the Settings | General Settings page. Near the bottom, you will find a Developer Tools section. There, you will find the Activate the developer mode link. Clicking on this enables the developer mode features for the current browser window, as shown in the following screenshot:

Figure 1.3 – The Developer Tools options section on the Settings page

Figure 1.3 – The Developer Tools options section on the Settings page

Note that the General Settings menu option is only visible if there is at least one app installed. If it is not available, install an app such as Contacts or CRM (or any other of your choice).

Changes in Odoo 13

In Odoo versions 10 to 12, the developer mode is enabled on the Settings | Dashboard page in the lower-right corner. For Odoo 9 and before, the developer mode is activated in the About dialog window, which is available from the User menu in the upper-right corner of the web client.

Once the developer mode is enabled, we will see the following menus made available:

  • On the top menu bar, the developer tools bug icon will be on the right-hand side next to the Conversations and Activities icons.
  • On the Settings app, the Technical and Translations menu items will be visible on the top bar.
Figure 1.4 – The Settings page with the developer mode enabled

Figure 1.4 – The Settings page with the developer mode enabled

The developer mode also enables additional information on the web client views – when hovering the mouse pointer over a field, a tooltip will display technical information relating to it.

Note

The developer mode can also be enabled by directly editing the current URL without having to leave the current page to open the settings. Edit the URL to change the .../web#... part to insert .../web?debug=1#... in its place. For example, http://localhost:8069/web#home would become http://localhost_8069/web?debug=1#home.

Using the developer mode with assets

For faster load times, the web client minifies the JavaScript and CSS assets into compact files. Unfortunately, that makes web client debugging nearly impossible.

The Activate the developer mode (with assets) option prevents this minification and loads the web assets in individual, non-minified files. This is useful to debug the web client itself, but it comes at the expense of making the web client navigation slower.

Tip

Both Firefox and Chrome browsers have extensions available providing a button to conveniently enable and disable the developer mode in Odoo. Search for Odoo Debug in their extension stores.

About Odoo Studio

It is also worth noting that both the Odoo EE and the Odoo SaaS edition offer the Odoo Studio app – an interactive application builder. We won't be using it because it's not available for the Odoo CE that is used as the example edition in this book.

Odoo Studio provides a user-friendly UI for the same interactive development features introduced in this chapter – along with a few extra features, such as the ability to export our customizations to a file.

Here, we will be using the developer mode (sometimes referred to as the debug mode) and the Technical menu, which are both available in all Odoo editions. Most of what can be built using Odoo Studio can also be built with these tools – albeit in a more technical way that is not as easy for non-developers.

You have been reading a chapter from
Odoo 15 Development Essentials - Fifth Edition
Published in: Feb 2022
Publisher: Packt
ISBN-13: 9781800200067
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime