0%

Book Description

Create fast and efficient server-side applications using the latest features of Odoo v11

About This Book

  • Get the most up-to-date guide on Odoo 11 to create custom and reusable modules
  • Interconnect your application with other systems by implementing web APIs
  • Understand the mechanisms powering the Odoo framework to build robust enterprises

Who This Book Is For

If you're a Python developer and want to develop highly efficient business applications with the latest Odoo framework (or if you just want a hands on problem solution book for all your Odoo Development related issues), this book is for you! Some experience with the JavaScript programming language and web development is required to get the most out of this book.

What You Will Learn

  • Install and manage Odoo environments and instances
  • Use models to define your application's data structures
  • Add business logic to your applications
  • Add automated tests and learn how to debug Odoo apps
  • Learn about the access security model and internationalization features
  • Customize websites built with Odoo, by writing your own templates and providing new snippets for use in the website builder
  • Extend the web client with new widgets and make RPC calls to the server

In Detail

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source are 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. Version 11 offers better usability and speed: a new design (as compared to the current Odoo Enterprise version) and a mobile interface.

The book starts by covering Odoo installation and administration and Odoo Server deployment. It then delves into the implementation of Odoo modules, the different inheritance models available in Odoo. You will then learn how to define access rules for your data; how to make your application available in different languages; how to expose your data models to end users on the back end and on the front end; and how to create beautiful PDF versions of your data.

By the end of the book, you will have a thorough knowledge of Odoo and will be able to build effective applications by applying Odoo development best practices

Style and Approach

This recipe-based practical guide presents each topic with step-by-step instructions on how you can create fast and efficient server-side applications using the latest features of Odoo v11

Table of Contents

  1. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Sections
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
      5. See also
    5. Get in touch
      1. Reviews
  2. Installing the Odoo Development Environment
    1. Introduction
    2. Easy installation of Odoo from source
      1. Getting ready
      2. How to do it...
      3. How it works...
        1. Virtual environments
        2. PostgreSQL configuration
        3. Git configuration
        4. Downloading the Odoo source code
        5. Starting the instance
      4. There's more…
    3. Managing Odoo environments using the start command
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
    4. Managing Odoo server databases
      1. Getting ready
      2. How to do it...
        1. Accessing the database management interface
        2. Setting or changing the master password
        3. Creating a new database
        4. Duplicating a database
        5. Removing a database
        6. Backing up a database
        7. Restoring a database backup
      3. How it works...
      4. There's more...
    5. Storing the instance configuration in a file
      1. How to do it...
      2. How it works...
    6. Activating the Odoo developer tools
      1. How to do it...
      2. How it works...
    7. Updating Odoo from source
      1. Getting ready
      2. How to do it...
      3. How it works...
  3. Managing Odoo Server Instances
    1. Introduction
    2. Configuring the addons path
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    3. Updating the addon modules list
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Standardizing your instance directory layout
      1. How to do it…
      2. How it works…
      3. See also
    5. Installing and upgrading local addon modules
      1. Getting ready
      2. How to do it…
        1. From the web interface
        2. From the command line
      3. How it works…
        1. Addon installation
        2. Addon update
      4. There's more…
    6. Installing addon modules from GitHub
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
    7. Applying changes to addons
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    8. Applying and trying proposed pull requests
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
  4. Server Deployment
    1. Introduction
    2. Installing Odoo for production use
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Server dimensioning
        2. PostgreSQL tuning
        3. Source code version
        4. Backups
      5. See also
    3. Adapting the configuration file for production
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Setting up Odoo as a system service
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Configuring a reverse proxy and SSL with nginx and Let's Encrypt
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Using buildout for repeatable builds
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Temporary merges
        2. Freezing a buildout
      5. See also
    7. Using Docker to run Odoo
      1. Getting ready
      2. How to do it…
        1. Building a Docker image
        2. Running Odoo in a container
      3. How it works…
      4. There's more…
  5. Creating Odoo Addon Modules
    1. Introduction
    2. Creating and installing a new addon module
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Completing the addon module manifest
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
    4. Organizing the addon module file structure
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Adding models
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Adding Menu Items and Views
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Adding Access Security
      1. Getting ready
      2. How to do it...
      3. How it works…
    8. Using scaffold to create a module
      1. Getting ready
      2. How to do it...
      3. How it works...
  6. Application Models
    1. Introduction
    2. Defining the Model representation and order
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Adding data fields to a Model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Using a float field with configurable precision
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Adding a monetary field to a Model
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Adding relational fields to a Model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Adding a hierarchy to a Model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Adding constraint validations to a Model
      1. Getting ready
      2. How to do it...
      3. How it works...
    9. Adding computed fields to a Model
      1. Getting ready
      2. How to do it...
      3. How it works...
    10. Exposing related fields stored in other Models
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    11. Adding dynamic relations using Reference fields
      1. Getting ready
      2. How to do it...
      3. How it works...
    12. Adding features to a Model using inheritance
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    13. Using abstract Models for reusable Model features
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    14. Using delegation inheritance to copy features to another Model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  7. Basic Server-Side Development
    1. Introduction
    2. Defining model methods and using the API decorators
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Reporting errors to the user
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Obtaining an empty recordset for a different model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also
    5. Creating new records
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
    6. Updating values of recordset records
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Searching for records
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Combining recordsets
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    9. Filtering recordsets
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    10. Traversing recordset relations
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    11. Extending the business logic defined in a Model
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    12. Extending write() and create()
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    13. Customizing how records are searched
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  8. Module Data
    1. Introduction
    2. Using external IDs and namespaces
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
    3. Loading data using XML files
      1. How to do it...
      2. How it works...
      3. There's more...
    4. Using the noupdate and forcecreate flags
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
    5. Loading data using CSV files
      1. How to do it...
      2. How it works...
      3. There's more...
    6. Loading data using YAML files
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
    7. Addon updates and data migration
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
  9. Debugging and Automated Testing
    1. Introduction
    2. Producing server logs to help debug methods
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Using the Odoo shell to interactively call methods
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Using the Python debugger to trace method execution
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Writing tests for your module using Python unit tests
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Running server tests
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Using the Odoo Community Association maintainer quality tools
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Using Pylint to check your code
        2. Using Flake8 to check your code
  10. Advanced Server-Side Development Techniques
    1. Introduction
    2. Changing the user performing an action
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Calling a method with a modified context
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    4. Executing raw SQL queries
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    5. Writing a wizard to guide the user
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Using the context to compute default values
        2. Wizards and code reuse
        3. Redirecting the user
    6. Defining onchange methods
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Calling onchange methods on the server side
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    8. Defining a model based on a SQL view
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  11. Backend Views
    1. Introduction
    2. Adding a menu item and window action
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
    3. Having an action open a specific view
      1. How to do it...
      2. How it works...
        1. ir.actions.act_window.view
    4. Adding content and widgets to a form view
      1. How to do it...
      2. How it works...
        1. Form
        2. Header
        3. Button
        4. Group
        5. Field
        6. General attributes
        7. Other tags
      3. There's more...
      4. See also
    5. Adding buttons to forms
      1. How to do it...
      2. How it works...
      3. There's more...
    6. Passing parameters to forms and actions – Context
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Defining filters on record lists – Domain
      1. How to do it...
      2. How it works...
      3. There's more...
        1. Operators
        2. Pitfalls
      4. See also
    8. List views
      1. How to do it...
      2. How it works...
      3. There's more...
    9. Search views
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
    10. Changing existing views – View inheritance
      1. How to do it...
      2. How it works...
      3. There's more...
        1. Order of evaluation in view inheritance
      4. See also
    11. Document-style forms
      1. How to do it...
      2. How it works...
    12. Dynamic form elements using attrs
      1. How to do it...
      2. How it works...
      3. There's more...
    13. Embedded views
      1. How to do it...
      2. How it works...
      3. There's more...
    14. Kanban views
      1. How to do it...
      2. How it works...
      3. There's more...
    15. Showing kanban cards in columns according to their state
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    16. Calendar and gantt views
      1. How to do it...
      2. How it works...
      3. There's more...
    17. Graph and pivot views
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  12. Access Security
    1. Creating security groups and assigning them to users
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Adding security access to models
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Limiting access to fields in models
      1. How to do it...
      2. How it works...
      3. There's more...
    4. Limiting record access using record rules
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Using security groups to activate features
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  13. Internationalization
    1. Installing a language and configuring user preferences
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    2. Configuring language-related settings
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Translating texts through the web client user interface
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Exporting translation strings to a file
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Using gettext tools to ease translations
      1. How to do it...
      2. How it works...
      3. There's more...
    6. Importing translation files into Odoo
      1. Getting ready
      2. How to do it...
      3. How it works...
  14. Automation, Workflows, Emails, and Printouts
    1. Introduction
    2. Using Kanban stages and features
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Creating server actions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Using Python code server actions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Using automated actions on time conditions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    6. Using automated actions on event conditions
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    7. Adding messaging and tracking features
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Email templates
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more…
      5. See also
    9. QWeb-based PDF reports
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    10. Producing LibreOffice-based reports with Py3O
      1. Getting ready
        1. Getting the report_py3o module in Odoo
        2. Installing and running a py3o.fusion server
      2. How to do it...
      3. How it works...
        1. Placeholders
        2. Control structures
      4. There's more...
  15. Web Server Development
    1. Introduction
    2. Making a path accessible from the network
      1. Getting ready
      2. How to do it...
      3. How it works...
        1. odoo.http.route
        2. Return values
        3. odoo.http.request
      4. There's more...
      5. See also
    3. Restricting access to web accessible paths
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    4. Consuming parameters passed to your handlers
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
    5. Modifying an existing handler
      1. Getting ready
      2. How to do it...
      3. How it works…
      4. There's more...
      5. See also
    6. Using the RPC API
      1. How to do it...
      2. How it works...
        1. XMLRPC
        2. JSONRPC
      3. There's more...
      4. See also
  16. Web Client Development
    1. Introduction
    2. Creating custom widgets
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
      5. See also
    3. Using client-side QWeb templates
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
      5. See also
    4. Making RPC calls to the server
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
      5. See also
    5. Writing tests for client-side code
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
      5. See also
    6. Debugging your client-side code
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
  17. CMS Website Development
    1. Introduction
    2. Extending CSS and JavaScript for the website
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Creating or modifying templates – QWeb
      1. Getting ready
      2. How to do it...
      3. How it works...
        1. Loops
        2. Attributes
        3. Fields
        4. Conditionals
        5. Inline editing
      4. There's more...
      5. See also
    4. Offering snippets to the user
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  18. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
3.142.173.227