更新时间:2021-07-16 11:00:59
coverpage
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
eBooks discount offers and more
Preface
What this book covers
Who this book is for
What you need for this book
Sections
Conventions
Reader feedback
Customer support
Chapter 1. Installing the Odoo Development Environment
Introduction
Easy installation of Odoo from source
Managing Odoo environments using the start command
Managing Odoo server databases
Storing the instance configuration in a file
Activating the Odoo developer tools
Updating Odoo from source
Chapter 2. Managing Odoo Server Instances
Configuring the addons path
Updating the addon modules list
Standardizing your instance directory layout
Installing and upgrading local addon modules
Installing addon modules from GitHub
Applying changes to addons
Applying and trying proposed pull requests
Chapter 3. Creating Odoo Modules
Creating and installing a new addon module
Completing the addon module manifest
Organizing the addon module file structure
Adding models
Adding Menu Items and Views
Using scaffold to create a module
Chapter 4. Application Models
Defining the Model representation and order
Adding data fields to a model
Using a float field with configurable precision
Adding a monetary field to a Model
Adding relational fields to a Model
Adding a hierarchy to a Model
Adding constraint validations to a Model
Adding computed fields to a Model
Exposing Related fields stored in other models
Adding dynamic relations using Reference fields
Adding features to a Model using inheritance
Using Abstract Models for reusable Model features
Using Delegation inheritance to copy features to another Model
Chapter 5. Basic Server Side Development
Defining model methods and use the API decorators
Reporting errors to the user
Obtaining an empty recordset for a different model
Creating new records
Updating values of recordset records
Searching for records
Combining recordsets
Filtering recordsets
Traversing recordset relations
Extending the business logic defined in a Model
Extending write() and create()
Customizing how records are searched
Chapter 6. Advanced Server Side Development Techniques
Change the user performing an action
Call a method with a modified context
Execute raw SQL queries
Write a wizard to guide the user
Define onchange methods
Call onchange methods on the server side
Port old API code to the new API
Chapter 7. Debugging and Automated Testing
Producing server logs to help debug methods
Using the Odoo shell to interactively call methods
Using the Python debugger to trace method execution
Writing tests for your module using YAML
Writing tests for your module using Python unit tests
Running server tests
Using the Odoo Community Association maintainer quality tools
Chapter 8. Backend Views
Adding a menu item and window action
Having an action open a specific view
Adding content and widgets to a form view
Adding buttons to forms
Passing parameters to forms and actions: Context
Defining filters on record lists: Domain
List views
Search views
Changing existing views: View inheritance
Document-style forms
Dynamic form elements using attrs