Book Image

Odoo 12 Development Cookbook - Third Edition

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

Odoo 12 Development Cookbook - Third Edition

By: Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis

Overview of this book

Odoo is a powerful framework known for rapid application development. Its latest release, Odoo 12, introduces tons of new features. With this book, you’ll learn how to develop powerful Odoo applications from scratch, using all the latest features. This Odoo cookbook starts by covering Odoo installation and deployment on the server. Next, you’ll explore the Odoo framework with real-world examples. You’ll create a new Odoo module from the ground up and progress to advanced framework concepts. You’ll also learn how to modify existing applications, including Point of Sale (POS). This book is not just limited to backend development; the advanced JavaScript recipes for creating new views and widgets will help you build beautiful UI elements. As you move forward, you’ll gain insights into website development and become a quality Odoo developer by studying performance optimization, debugging, and automated tests. Finally, you’ll learn the latest concepts like multi-website, In-App Purchasing (IAP),, and IoT Box. By the end of the book, you’ll have all the knowledge you need to build powerful Odoo applications. The development best practices used in this book will undoubtedly come handy when you are working with the Odoo framework.
Table of Contents (26 chapters)

What this book covers

Chapter 1, Installing the Odoo Development Environment, starts with an introduction to the Odoo ecosystem. Here you will learn how to install and set up Odoo for the development environment. You will also learn how to activate developer tools.

Chapter 2, Managing Odoo Server Instances, is about installing and upgrading add-ons. It provides you with useful tips to organize custom add-ons downloaded from GitHub.

Chapter 3, Server Deployment, is about how to install and configure Odoo instances for production use. This chapter includes the NGINX reverse proxy, SSL configuration, the startup service, and basic Docker deployment. It also includes the configuration for the CDN of a website.

Chapter 4, Creating Odoo Add-On Modules, explains the structure of the Odoo add-on module and provides a step-by-step guide to create a simple Odoo module from scratch.

Chapter 5, Application Models, focuses on Odoo model structure, and explains all types of fields with their attributes. This chapter also includes different ways to inherit and extend existing models.

Chapter 6, Basic Server-Side Development, introduces the API of the Odoo framework, presenting the usage of CRUD methods and other commonly used methods. This chapter also explains how to write business logic in Odoo.

Chapter 7, Module Data, shows how to ship built-in data along with your add-on module. It also explains the basic steps to write migration functions.

Chapter 8, Debugging, provides different strategies for debugging Odoo code. This chapter includes the usage of developer options and Odoo shell.

Chapter 9, Advanced Server-Side Development Techniques, covers more advanced topics of the ORM framework. It is useful for developing wizards, SQL views, installation hooks, on-change methods, and more. This chapter also explains how to execute raw SQL queries in the database.

Chapter 10, Backend Views, teaches you how to create different UI views and how to invoke the business logic from the user interface. It covers the all of the usual views, such as the list, form, kanban, calendar, graph, search, and pivot, as well as newly introduced views, such as cohort and dashboard. This chapter also includes a recipe for modifying/inheriting existing views.

Chapter 11, Access Security, covers the security aspect of the Odoo framework. It shows how to control/restrict user access on the models by creating security groups, access control lists, and record level rules.

Chapter 12, Internationalization, shows how to translate the user interface for your add-on modules, and provides useful tricks for managing translation files.

Chapter 13, Automation, Workflows, and Printouts, illustrates the different tools and techniques available in Odoo to implement better business processes. It shows how to use server actions, automated actions, and time-based scheduled actions. This chapter also includes a recipe for creating PDF reports for your model.

Chapter 14, Web Server Development, covers the core of the Odoo web server. It shows how to create custom URL routes to serve data on a given URL, and also shows how to control access to these URLs.

Chapter 15, CMS Website Development, show how to manage a website with Odoo. It also shows how to create and modify beautiful web pages and QWeb templates. This chapter also includes how to create dynamic building blocks with options. It includes some dedicated recipes for managing SEO, user forms, UTM tracking, sitemaps, and fetching visitor location information. This chapter also highlights the latest concept of a multi-website in Odoo.

Chapter 16, Web Client Development, dives into the JavaScript part of the Odoo. It covers how to create a new field widget and make RPC calls to the server. This also includes how to create a brand new view from scratch. You will also learn how to create on-boarding tours.

Chapter 17, In-App Purchasing with Odoo, covers everything related to the latest concept of In-App Purchasing (IAP) in Odoo. In this chapter, you will learn how to create client and service modules for IAP. You will also learn how to create an IAP account and draw IAP credits from the end user.

Chapter 18, Automated Test Cases, covers how to write and execute automated test cases in Odoo, including server-side, client-side, and tour integration test cases. This chapter also has a recipe to set up chrome-headless to capture screenshots and videos to see failed client-side test cases.

Chapter 19, Managing, Deploying, and Testing with, explains, a PaaS platform for deploying Odoo instances that cover different aspects of the production, staging, and development branches. This also explains the different options of the platform.

Chapter 20, Remote Procedure Calls in Odoo, covers different ways to connect Odoo instances from external applications. This chapter teaches you how to connect and access the data from an Odoo instance through XML-RPC, JSON-RPC, and the odoorpc library.

Chapter 21, Performance Optimization, explains the different concepts and patterns used to gain performance improvements in Odoo. This chapter includes the concept of prefetching, ORM-cache, and profiling the code to detect performance issues.

Chapter 22, Point of Sale, covers customization in a point-of-sale application. This includes customization of the user interface, adding a new action button, modifying business flow, and extending customer recipes.

Chapter 23, Manage Emails in Odoo, explains how to manage email and chatter in Odoo. It starts with configuring mail servers and moves towards the mailing API of the Odoo framework. This chapter also covers the Jinja2 and QWeb mail templates, chatters on the form view , field logs, and activities.

Chapter 24, IoT Box, gives you the highlight of the latest hardware of IoT Box. This chapter covers how to configure, access, and debug IoT Box. It also includes a recipe to integrate IoT Box with your custom add-ons.