Book Image

Odoo 14 Development Cookbook - Fourth Edition

By : Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
5 (2)
Book Image

Odoo 14 Development Cookbook - Fourth Edition

5 (2)
By: Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis

Overview of this book

With its latest iteration, the powerful Odoo framework released a wide variety of features for rapid application development. This updated Odoo development cookbook will help you explore the new features in Odoo 14 and learn how to use them to develop Odoo applications from scratch. You'll learn about the new website concepts in Odoo 14 and get a glimpse of Odoo's new web-client framework, the Odoo Web Library (OWL). Once you've completed the installation, you'll begin to explore the Odoo framework with real-world examples. You'll then 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) applications. This book isn't just limited to backend development; you'll discover advanced JavaScript recipes for creating new views and widgets. As you progress, you'll learn about website development and become a quality Odoo developer by studying performance optimization, debugging, and automated testing. Finally, you'll delve into advanced concepts such as multi-website, In-App Purchasing (IAP), Odoo.sh, the IoT Box, and security. By the end of the book, you'll have all the knowledge you need to build impressive Odoo applications and you'll be well versed in development best practices that will come in handy when working with the Odoo framework.
Table of Contents (26 chapters)

Applying changes to add-ons

Most add-ons that are available on GitHub are subject to change and do not follow the rules that Odoo enforces for its stable release. They may receive bug fixes or enhancements, including issues or feature requests that you have submitted, and these changes may introduce database schema changes or updates in the data files and views. This recipe explains how to install the updated versions.

Getting ready

Suppose you reported an issue with partner_contact_gender and received a notification that the issue was solved in the last revision of the 14.0 branch of the partner-contact project. In this case, you will want to update your instance with this latest version.

How to do it…

To apply a source modification to your add-on from GitHub, you need to perform the following steps:

  1. Stop the instance using that add-on.
  2. Make a backup if it is a production instance (refer to the Manage Odoo server databases recipe in Chapter 1, Installing the Odoo Development Environment).
  3. Go to the directory where partner-contact was cloned:
    $ cd ~/odoo-dev/my-odoo/src/partner-contact
  4. Create a local tag for the project so that you can revert to that version in case things break:
    $ git checkout 14.0
    $ git tag 14.0-before-update-$(date --iso)
  5. Get the latest version of the source code:
    $ git pull --ff-only
  6. Update the partner_address_street3 add-on in your databases (refer to the Installing and upgrading local add-on modules recipe).
  7. Restart the instance.

How it works…

Usually, the developer of the add-on module occasionally releases the newest version of the add-on. This update typically contains bug fixes and new features. Here, we will get a new version of the add-on and update it in our instances.

If git pull --ff-only fails, you can revert to the previous version using the following command:

$ git reset --hard 14.0-before-update-$(date --iso)

Then, you can try git pull (without --ff-only), which will cause a merge, but this means that you have local changes on the add-on.

See also

If the update step breaks, refer to the Updating Odoo from Source recipe in Chapter 1, Installing the Odoo Development Environment, for recovery instructions. Remember to always test an update on a copy of a database production first.