Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Odoo Development Cookbook
  • Table Of Contents Toc
Odoo Development Cookbook

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
4.6 (5)
close
close
Odoo Development Cookbook

Odoo Development Cookbook

4.6 (5)
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 (18 chapters)
close
close
17
Index

Using the Python debugger to trace method execution


Sometimes, application logs are not enough to figure out what is going wrong. Fortunately, we have the Python debugger available to us. This recipe shows how to insert a break point in a method and trace the execution by hand.

Getting ready

We will be reusing the export_stock_level() method shown in the two previous recipes. Be sure to have a copy at hand.

How to do it…

In order to trace the execution of export_stock_level() with pdb, follow the following steps:

  1. Edit the code of the method, and insert the line highlighted here:

    def export_stock_level(self, stock_location):
        import pdb; pdb.set_trace()
        products = self.with_context(
            location=stock_location.id
        ).search([])
        fname = join(EXPORTS_DIR, 'stock_level.txt')
        try:
            with open(fname, 'w') as fobj:
                for prod in products.filtered('qty_available'):
                    fobj.write('%s\t%f\n' % (prod.name, prod.qty_available))
        except IOError:
           ...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Odoo Development Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon