Book Image

Odoo Development Cookbook

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

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is 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. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Debugging your client side code


For debugging server side code, this book contains a whole chapter, that is, Chapter 7, Debugging and Automated Testing. For the client side part, you'll get a kick start in this recipe.

Getting ready

This recipe doesn't really rely on specific code, but if you want to be able to reproduce exactly what's going on, grab the previous recipe's code.

How to do it...

What makes debugging client side script hard is that the web client heavily relies on jQuery's asynchronous events. Given that breakpoints halt execution, the chance is high that a bug caused by timing issues will not occur when debugging. We'll discuss some strategies for this later:

  1. Turn on debug mode by selecting About in the top right user menu, and clicking Activate developer mode. For details, consult the Chapter 1, Installing the Odoo Development Environment, recipe Activate developer tools.

  2. In a JavaScript function you're interested in, call the debugger:

    debugger;
  3. If you have timing problems, log...