Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Odoo 12 Development Essentials
Odoo 12 Development Essentials

Odoo 12 Development Essentials: Fast-track your Odoo development skills to build powerful business applications , Fourth Edition

Arrow left icon
Profile Icon Daniel Reis
Arrow right icon
Can$34.98 Can$49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (5 Ratings)
eBook Dec 2018 404 pages 4th Edition
eBook
Can$34.98 Can$49.99
Paperback
Can$61.99
Subscription
Free Trial
Arrow left icon
Profile Icon Daniel Reis
Arrow right icon
Can$34.98 Can$49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4 (5 Ratings)
eBook Dec 2018 404 pages 4th Edition
eBook
Can$34.98 Can$49.99
Paperback
Can$61.99
Subscription
Free Trial
eBook
Can$34.98 Can$49.99
Paperback
Can$61.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Odoo 12 Development Essentials

Preparing the Development Environment

Before we dive into Odoo development, we need to set up our development environment and learn the basic administration tasks for it.

In this chapter, we will learn how to set up the working environment where we will build our Odoo applications. We will set up an Ubuntu system to host the development server instance. This can be a cloud server, a local network server, or a subsystem in your Windows 10 computer.

We will learn how to do the following:

  • Set up the host computer, either an Ubuntu system or a Windows 10 system, with the Windows Subsystem for Linux
  • Install Odoo from source, including the installation of the database and the system dependencies
  • Manage Odoo databases includes creating, dropping, and copying
  • Configure the Odoo server options
  • Find and install community add-on modules
  • Use virtual environments to manage...

Technical requirements

This chapter will guide you to install Odoo from source in your development computer. Ideally, we need an Ubuntu 18.04 operating system. A Windows 10 system is also an option, since we will explain how to set up Ubuntu in the Windows Subsystem for Linux.

Some reference code for this chapter can be found in the book's GitHub repository, https://github.com/PacktPublishing/Odoo-12-Development-Essentials-Fourth-Edition, in the ch02/ directory.

Setting up a host for the Odoo server

A Debian/Ubuntu system is recommended to run Odoo servers. While Odoo is multi-platform and can run on a variety of operating systems, it's also true that the Odoo R&D team considers Debian the reference deployment platform. In fact, Odoo's own SaaS operations are known to be Debian-based. It is also the most popular choice in the community. This means that it will be easier to find help or advice if you use Debian or Ubuntu. Even if you're from a Windows background, it will be important that you have some knowledge about it.

You will still be able to work from your favorite desktop system, be it Windows, Mac, or other Linux flavors, such as CentOS.

Keep in mind that these instructions are intended to set up a new system for development. If you want to try some of them in an existing system, always take a backup ahead of...

Installing Odoo from source

In Chapter 1, Quick Start Using the Developer Mode, we discussed the different options available to quickly get Odoo running on our computer. We want to go a little deeper, and run Odoo directly from the source code.

Odoo is built using the Python programming language, and it uses the PostgreSQL database for data storage; these are the two main requirements of an Odoo host. To run Odoo from source, we will first need to install the Python libraries it depends on. The Odoo source code can then be downloaded from GitHub. While we can download a ZIP file or tarball, we will see that it's better if we get the sources using the Git version control application; it'll help us to have it installed on our Odoo host as well.

The exact dependency installation may vary depending on your operating system and on the Odoo version you are installing. If you...

Managing Odoo databases

We've seen how to create and initialize new Odoo databases from the command line. There are more commands worth knowing about for managing databases.

Although the Odoo server automatically takes care of managing databases, we can manually create PostgreSQL databases from the command line, using the following:

$ createdb MyDB

More interestingly, Odoo can also create a new database by copying an existing one, using the --template option. For this to work, the copied database can't have open connections to it, so make sure your Odoo instance is stopped and there is no other connection open for it. The command to use looks like this:

$ createdb --template=MyDB MyDB2

In fact, every time we create a database, a template is used. If none is specified, a predefined one called template1 is used.

To list the existing databases in your system, use the...

More server configuration options

The Odoo server supports quite a few other options. We can check all the available options with --help:

$ ~/odoo-dev/odoo/odoo-bin --help

We will review some of the most important options in the following sections. Let's start by looking at how the currently active options can be saved in a configuration file.

Odoo server configuration files

Most of the options can be saved in a configuration file. By default, Odoo will use the .odoorc file. In Linux systems, its default location is in the home directory ($HOME), and in the Windows distribution, it is in the same directory as the executable used to launch Odoo.

In older Odoo/OpenERP versions, the name for the default configuration file...

Installing additional modules

Making new modules available in an Odoo instance so they can be installed is something that newcomers to Odoo frequently find confusing. But it doesn't have to be, so let's get familiar with that.

Finding community modules

There are many Odoo modules available on the internet. The Odoo app store at apps.odoo.com is a catalog of modules that can be downloaded and installed on your system. Another important resource is the Odoo Community Association (OCA) maintained modules, also available on GitHub at https://github.com/OCA/. The OCA is a non-profit organization created to coordinate community contributions, promoting software quality, development best practices, and open source values...

Installing Odoo in a Python virtual environment

It is a common case among Odoo developers to maintain code for several Odoo versions. Some organizational effort is needed to keep these projects alongside each other and working on the same development machine. And, there is some context switching needed when changing from one version to another. For example, the Odoo start executable is now odoo-bin, but in older versions it was odoo.py, and you need to remember that. With the move to Python 3, this can be even more confusing; you need to choose whether to use python / pip or python3 / pip3, depending on the Odoo server version you are working on at that moment.

Python includes virtualenv, a tool to manage independent Python environments on the same machine. Each environment has its own Python executable and installed libraries. You just need to activate the environment...

Technical requirements


This chapter will guide you to install Odoo from source in your development computer. Ideally, we need an Ubuntu 18.04 operating system. A Windows 10 system is also an option, since we will explain how to set up Ubuntu in the Windows Subsystem for Linux.

Some reference code for this chapter can be found in the book's GitHub repository, https://github.com/PacktPublishing/Odoo-12-Development-Essentials-Fourth-Edition, in the ch02/ directory.

Setting up a host for the Odoo server


A Debian/Ubuntu system is recommended to run Odoo servers. While Odoo is multi-platform and can run on a variety of operating systems, it's also true that the Odoo R&D team considers Debian the reference deployment platform. In fact, Odoo's own SaaS operations are known to be Debian-based. It is also the most popular choice in the community. This means that it will be easier to find help or advice if you use Debian or Ubuntu. Even if you're from a Windows background, it will be important that you have some knowledge about it.

You will still be able to work from your favorite desktop system, be it Windows, Mac, or other Linux flavors, such as CentOS.

Note

Keep in mind that these instructions are intended to set up a new system for development. If you want to try some of them in an existing system, always take a backup ahead of time in order to be able to restore it in case something goes wrong.

Installing the Windows Subsystem for Linux

On a Windows system...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore Odoo 12 capabilities to develop business applications
  • Program business logic and manipulate data to implement specific business rules in your applications
  • Integrate Python APIs for building customizable and scalable business logic

Description

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.

Who is this book for?

If you are a developer familiar with Python and MVC design and want to build business applications using Odoo, this book is for you.

What you will learn

  • Manage Odoo server instances
  • Create a new Odoo application from scratch using the most frequently used elements
  • Develop new models and use inheritance to extend existing models
  • Use ORM methods in the Odoo server and from external clients
  • Create Kanban views using QWeb effectively
  • Build custom web and website CMS pages
  • Use external APIs to integrate Odoo with external applications
  • Add automated tests and techniques to debug module business logic

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 28, 2018
Length: 404 pages
Edition : 4th
Language : English
ISBN-13 : 9781789538984
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 28, 2018
Length: 404 pages
Edition : 4th
Language : English
ISBN-13 : 9781789538984
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 245.97
Learn Odoo
Can$69.99
Odoo 12 Development Essentials
Can$61.99
Odoo 12 Development Cookbook
Can$113.99
Total Can$ 245.97 Stars icon

Table of Contents

16 Chapters
Quick Start Using the Developer Mode Chevron down icon Chevron up icon
Preparing the Development Environment Chevron down icon Chevron up icon
Your First Odoo Application Chevron down icon Chevron up icon
Extending Modules Chevron down icon Chevron up icon
Import, Export, and Module Data Chevron down icon Chevron up icon
Models – Structuring the Application Data Chevron down icon Chevron up icon
Recordsets – Working with Model Data Chevron down icon Chevron up icon
Business Logic – Supporting Business Processes Chevron down icon Chevron up icon
External API – Integrating with Other Systems Chevron down icon Chevron up icon
Backend Views – Designing the User Interface Chevron down icon Chevron up icon
Kanban Views and Client-Side QWeb Chevron down icon Chevron up icon
Reports and Server-Side QWeb Chevron down icon Chevron up icon
Creating Website Frontend Features Chevron down icon Chevron up icon
Deploying and Maintaining Production Instances Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(5 Ratings)
5 star 80%
4 star 0%
3 star 0%
2 star 20%
1 star 0%
G. Wideman Apr 07, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I post this review after only an initial read and skim. The book doesn't require performing all the step-by-step exercises on an installation of Odoo, but doing so would surely contribute to understanding the material (and trying out related points beyond the book's specifics). I have not done those exercises yet, so can't speak to their detailed accuracy, but since this book has no reviews yet, and books specific to a software version have a short shelf life, I thought I'd post a preliminary review about a crucial aspect of this one.In the past I've found Packt books rather consistently disappointing, shoddy and sometimes outright terrible. Page after page of significant technical and factual errors, incomprehensibly vague word-salad sentences, language translations that looked like they came direct from google translate with no editing, and so on.I want to assure prospective purchasers that this book has none of that. It's written in clear, precise English, for which I commend the author and editors.You can judge from "Look Inside" whether it covers the topics you want to know, and I'll add that in each of those chapters the narrative covers the material in a coherent and comprehensible manner, each topic building to the next. The author goes to some length in sidebar hints and tips to thoughtfully anticipate related points you'll want to know, and also to highlight differences from previous versions.In short, if you have had a previous negative experience with Packt books, you can relax your skepticism for this one.If I have a criticism it would be that while the book has numerous helpful screenshots (of a readable size and competently printed!), it almost completely lacks diagrams; some E-R (or UML) diagrams would have been very useful to further illuminate the models and relationships between them that the narrative discusses. However, this is a shortcoming not at all unique to this book . I would also have liked the book to cover structure and customization of particular modules, such as inventory/products and eCommerce. I suspect that kind of coverage was deliberately outside the scope of the current book, but it would make for a very useful second book, or companion material.That said, "well done" author and team, and I hope that Packt continues with this quality level and better.
Amazon Verified review Amazon
Ignacio Jan 27, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Muchas mejoras en la organización del libro respecto a las precedentes. Incorpora avisos muy útiles sobre las novedades de la versión 12 sin perder de vista las versiones anteriores soportadas por Odoo. Esta edición no es un copia y pega de las anteriores. Ha sido cuidadosamente re elaborada y cubre casi todos los aspectos esenciales para el desarrollador novel (y no tan novel) en Odoo. Libro que merece la compra de las dos ediciones (kindle e impresa) para tener la obra siempre a mano. Felicidades al autor.
Amazon Verified review Amazon
Nelson Ramírez Jan 05, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Even you are an Expert or not, I recommend this book. It's imposible to remember all the development tricks. This is a book that will use many times to have a it as a reinforcement. Love it, proud of having it.
Amazon Verified review Amazon
Greg Mader Oct 27, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Daniel's book solves a huge problem in the Odoo community-- Documentation. Odoo is the greatest platform most have not heard of, and in part, it is due to the lack of books like this. Daniel's efforts in this and other books have made a tremendous difference for a lot of people.
Amazon Verified review Amazon
Rachmat Kosasih Sep 06, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
I tried to follow the example, but stuck right at the first exercise.In section Adding a field to a form view, it provides the code for the architecture. I got error response from my Odoo dev server right after key in the closing bracket.Found another err:Create new model for library app, loaded ok, however few paragraph below, under section Setting up access security, it showed wrong warning, instead of model library.book, it showed mode todo.task
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.