In Chapter 3, Your First Odoo Application, we created the library_app add-on module, implementing a simple library.book model to represent the book catalog. In this chapter, we will revisit that module to enrich the data we can store regarding each book.
We will add a category hierarchy, to use for book categorization, with the following:
- Name: The category title
- Parent: The Parent category it belongs to
- Subcategories: The categories that have this one as parent
- Featured book or author: A selected book or author that represents this category
The book model already has fields for essential information, and we will add a few more to showcase the several data types available in Odoo.
We will also add some constraints to the Books Model:
- The title and publication date should be unique
- ISBNs entered should be valid...