Models are meant to store data, and this data is structured in fields. Here, we will learn about the several types of data that can be stored in fields, and how to add them to a model.
This recipe assumes that you have an instance ready with the
my_module addon module available, as described in Chapter 3, Creating Odoo Modules.
my_module addon module should already have a
models/library_book.py defining a basic Model. We will edit it to add new fields:
from openerp import models, fields class LibraryBook(models.Model): # ... short_name = fields.Char('Short Title') notes = fields.Text('Internal Notes') state = fields.Selection( ...