Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Odoo 11 Development Cookbook - Second Edition

You're reading from   Odoo 11 Development Cookbook - Second Edition Over 120 unique recipes to build effective enterprise and business applications

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781788471817
Length 470 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Alexandre Fayolle Alexandre Fayolle
Author Profile Icon Alexandre Fayolle
Alexandre Fayolle
Holger Brunn Holger Brunn
Author Profile Icon Holger Brunn
Holger Brunn
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Installing the Odoo Development Environment FREE CHAPTER 2. Managing Odoo Server Instances 3. Server Deployment 4. Creating Odoo Addon Modules 5. Application Models 6. Basic Server-Side Development 7. Module Data 8. Debugging and Automated Testing 9. Advanced Server-Side Development Techniques 10. Backend Views 11. Access Security 12. Internationalization 13. Automation, Workflows, Emails, and Printouts 14. Web Server Development 15. Web Client Development 16. CMS Website Development 17. Other Books You May Enjoy

To get the most out of this book

This book is meant for developers, and it is not a development tutorial. It expects you to be familiar with the Python programming language (especially in the backend development chapters), the JavaScript programming language (especially in the front end development chapters). Since the data files in the modules are often formatted as XML files, some knowledge of the XML syntactic rule is definitely welcome.

Odoo will run without problem on any recent GNU/Linux distribution. In order to simplify the code in the recipes, we chose to Debian GNU/Linux 9 (code name Stretch), so it will also help if you had some previous acquaintance with the apt-get command used to install software packages, and some notions about GNU/Linux system administration.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Odoo-11-Development-Coobook-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Create a virtualenv and install the dependencies"

A block of code is set as follows:

from odoo import models, fields, api 
class LibraryBook(models.Model): 
    # [...] 
    state = fields.Selection([('draft', 'Unavailable'), 
                              ('available', 'Available'), 
                              ('borrowed', 'Borrowed'), 
                              ('lost', 'Lost')], 
                             'State') 

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

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: raise exceptions.UserError('unable to save file')

Any command-line input or output is written as follows:

$ ../odoo/odoo-bin --save --config myodoo.cfg --stop-after-init

In the example above $ is the command line prompt, and it should not be typed. When the command line prompt is a hash sign (#), this means that the command must be run as the root user. Some command lines had to be wrapped on multiple lines due to the width of the pages. In these cases, there is a backslash (\) at the end of the line. When typing the command you may want to ignore these backslashes completely and not input them, entering the whole command on a single line. If you choose to type them, you must not add any spaces after the backslash and hit the Return key immediately to insert a new line character just after the backslash.

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Go to the Settings menu."

Warnings or important notes appear like this.
Tips and tricks appear like this.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime