O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Odoo 10 Development Essentials

Book Description

Fast-track your development skills to build powerful Odoo 10 business applications

About This Book

  • Get the most up-to-date guide on Odoo 10 and learn how to build excellent business applications with Odoo
  • This example-rich, easy-to-follow guide enables you to build apps appropriate to your business needs
  • Create solid business applications with the help of this precise, to-the-point guide

Who This Book Is For

This book caters to developers who are familiar with Python and MVC design and now want to build effective business applications using Odoo.

What You Will Learn

  • Install Odoo from source code and use all the basic techniques to setup and manage your Odoo server instances
  • Create your first Odoo application
  • Add Odoo's social and messaging features to your own modules
  • Get to know the essentials of Models and Views
  • Understand and use the server API to add business logic
  • Use Qweb to create custom Reports
  • Extend Odoo CMS features to create your own website controllers and pages
  • Leverage Odoo Workflows on your applications
  • Write module automated tests and debugging techniques
  • Deploy your Odoo applications for production use

In Detail

Odoo is one of the fastest growing open source, business application development software products available. With announcement of Odoo 10, there are many new features added to Odoo and the face of business applications developed with Odoo has changed. This book will not only teach you how to build and customize business applications with Odoo, but it also covers all the new features that Odoo has to offer.

This book is the latest resource on developing and customizing Odoo 10 applications. It comes packed with much more and refined content than its predecessor. It will start with building business applications from scratch and will cover topics such as module extensions, inheritance, working with data, user interfaces, and so on. The book also covers the latest features of Odoo 10, in addition to front end development, testing and debugging techniques. The book will also talk about Odoo Community and Odoo Enterprise.

Style and approach

This book follows a step-by-step practical approach where you will learn new concepts with every progressing chapter and create apps for business development.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Odoo 10 Development Essentials
    1. Odoo 10 Development Essentials
    2. Credits
    3. Foreword
    4. About the Author
    5. About the Reviewer
    6. www.PacktPub.com
      1. Why subscribe?
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Getting Started with Odoo Development
      1. Setting up a host for the Odoo server
        1. Provision for a Debian host
        2. Creating a user account for Odoo
      2. Installing Odoo from the source
      3. Initializing a new Odoo database
        1. Managing your databases
      4. A word about Odoo product versions
      5. More server configuration options
        1. Odoo server configuration files
        2. Changing the listening port
        3. The database filter option
        4. Managing server log messages
      6. Developing from your workstation
        1. Using a Linux text editor
        2. Installing and configuring Samba
        3. Activating the developer tools
      7. Installing third-party modules
        1. Finding community modules
        2. Configuring the addons path
        3. Updating the apps list
      8. Summary
    9. 2. Building Your First Odoo Application
      1. Essential concepts
        1. Understanding applications and modules
        2. Modifying and extending modules
        3. Creating the module basic skeleton
        4. A word about licenses
        5. Adding to the addons path
        6. Installing the new module
        7. Upgrading a module
        8. The server development mode
      2. The model layer
        1. Creating the data model
        2. Adding automated tests
      3. The view layer
        1. Adding menu items
        2. Creating the form view
        3. Business document form views
        4. Adding action buttons
        5. Using groups to organize forms
        6. The complete form view
        7. Adding list and search views
      4. The business logic layer
        1. Adding business logic
        2. Adding tests
      5. Setting up access security
        1. Testing access security
        2. Adding access control security
        3. Row-level access rules
      6. Better describing the module
      7. Summary
    10. 3. Inheritance – Extending Existing Applications
      1. Adding sharing capabilities to the To-Do app
      2. Extending models
        1. Adding fields to a model
        2. Modifying existing fields
        3. Modifying model methods
      3. Extending views
        1. Extending the form view
        2. Extending the tree and search views
      4. More model inheritance mechanisms
        1. Copying features with prototype inheritance
        2. Embedding models using delegation inheritance
        3. Adding the social network features
      5. Modifying data
        1. Modifying menu and action records
        2. Modifying security record rules
      6. Summary
    11. 4. Module Data
      1. Understanding external identifiers
        1. Finding external identifiers
      2. Exporting and importing data
        1. Exporting data
        2. Importing data
        3. Related records in CSV data files
      3. Module data
        1. Demonstration data
      4. XML data files
        1. The data noupdate attribute
        2. Defining records in XML
          1. Setting field values
          2. Setting values using expressions
          3. Setting values for relation fields
        3. Shortcuts for frequently used models
        4. Other actions in XML data files
          1. Deleting records
          2. Triggering functions and workflows
      5. Summary
    12. 5. Models – Structuring the Application Data
      1. Organizing application features into modules
        1. Introducing the todo_ui module
      2. Creating models
        1. Model attributes
        2. Models and Python classes
        3. Transient and Abstract models
        4. Inspecting existing models
      3. Creating fields
        1. Basic field types
        2. Common field attributes
        3. Special field names
      4. Relationships between models
        1. Many-to-one relationships
        2. Many-to-many relationships
        3. One-to-many inverse relationships
        4. Hierarchic relationships
        5. Reference fields using dynamic relationships
      5. Computed fields
        1. Searching and writing on computed fields
        2. Storing computed fields
        3. Related fields
      6. Model Constraints
      7. Summary
    13. 6. Views - Designing the User Interface
      1. Defining the user interface with XML files
        1. Menu items
        2. Window actions
      2. Context and domain
        1. Context data
        2. Domain expressions
      3. The form views
        1. Dealing with several views of the same type
        2. Business document views
          1. The header
          2. The sheet
          3. Title and subtitle
          4. Smart buttons area
          5. Grouping content in a form
          6. Tabbed notebooks
      4. View semantic components
        1. Fields
          1. Labels for fields
          2. Relational fields
          3. Field widgets
        2. Buttons
        3. Smart buttons
      5. Dynamic views
        1. On change events
        2. Dynamic attributes
      6. List views
      7. Search views
      8. Calendar views
      9. Graph and pivot views
      10. Other view types
      11. Summary
    14. 7. ORM Application Logic – Supporting Business Processes
      1. Creating a wizard
        1. The wizard model
        2. The wizard form
        3. The wizard business logic
        4. Logging
        5. Raising exceptions
        6. Helper actions in wizards
      2. Working with the ORM API
        1. Method decorators
        2. Overriding the ORM default methods
        3. Methods for RPC and web client calls
        4. The shell command
        5. The server environment
        6. Modifying the execution environment
        7. Transactions and low-level SQL
      3. Working with recordsets
        1. Querying models
        2. Singletons
        3. Writing on records
        4. Working with time and dates
        5. Operations on recordsets
        6. Manipulating recordsets
        7. Using relational fields
        8. Working with relational fields
      4. Summary
    15. 8. Writing Tests and Debugging Your Code
      1. Unit tests
      2. Adding unit tests
      3. Writing test cases
      4. Setting up tests
      5. Testing exceptions
      6. Running tests
      7. About YAML tests
      8. Development tools
        1. Server development options
        2. Debugging
          1. The Python debugger  
          2. A sample debugging session
          3. Alternative Python debuggers
          4.  Printing messages and logging 
        3. Inspecting running processes
      9. Summary
    16. 9. QWeb and Kanban Views
      1. About kanban boards
        1. Kanban views
      2. Designing kanban views
        1. Priority, kanban state, and color
        2. Kanban card elements
        3. The kanban card layout
        4. Adding a kanban card option menu
        5. Actions in kanban views
      3. The QWeb templating language
        1. The QWeb JavaScript evaluation context
        2. Using t-attf for attributes string substitution
        3. Using t-att for dynamic attributes
        4. Using t-foreach for loops
        5. Using t-if for conditional rendering
        6. Using t-esc and t-raw to render values
        7. Using t-set to set values on variables
        8. Using t-call to insert other templates
        9. More ways to use t-attf
      4. Inheritance on kanban views
      5. Custom CSS and JavaScript assets
      6. Summary
    17. 10. Creating QWeb Reports
      1. Installing wkhtmltopdf
      2. Creating business reports
      3. QWeb report templates
      4. Presenting data in reports
      5. Rendering images
      6. Summary totals and running totals
      7. Defining paper formats
      8. Enabling language translation in reports
      9. Reports based on custom SQL
      10. Summary
    18. 11. Creating Website Frontend Features
      1. Roadmap
      2. Our first web page
        1. Hello World!
        2. Hello World! with a Qweb template
        3. Extending web features
        4. HelloCMS!
      3. Building websites
        1. Adding CSS and JavaScript assets
        2. The to-do list controller
        3. The to-do list template
        4. The To-do Task detail page
      4. Website forms
        1. The form page
        2. Access security and menu item
        3. Adding custom logic
      5. Summary
    19. 12. External API – Integrating with Other Systems
      1. Setting up a Python client
      2. Calling the Odoo API using XML-RPC
        1. Opening an XML-RPC connection
        2. Reading data from the server
        3. Calling other methods
      3. Writing a Notes desktop application
        1. Communication layer with Odoo
        2. Creating the GUI
      4. Introducing the ERPpeek client
        1. The ERPpeek API
        2. The ERPpeek CLI
      5. Summary
    20. 13. Deployment Checklist – Going Live
      1. Available prebuilt packages
      2. Installing dependencies
        1. Preparing a dedicated system user
        2. Installing from the source code
        3. Setting up the configuration file
      3. Multiprocessing workers
        1. Setting up as a system service
        2. Creating a systemd service
        3. Creating an Upstart/sysvinit service
        4. Checking the Odoo service from the command line
      4. Using a reverse proxy
        1. Setting up Nginx for reverse proxy
        2. Enforcing HTTPS
        3. Nginx optimizations
        4. Long polling
      5. Server and module updates
      6. Summary