Chapter 4: Application Models
The recipes in this chapter will make small additions to an existing add-on module. In the previous chapter, we registered our add-on module in the Odoo instance. In this chapter, we will dive deeply into the database side of the module. We will add a new model (database table), new fields, and constraints. We will also examine the use of inheritance in Odoo. We will be using the module we created in the recipes in Chapter 3, Creating Odoo Add-On Modules.
In this chapter, we will cover the following recipes:
- 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...