This recipe assumes that you have an instance ready, with the my_module addon module available, as described in Chapter 4, Creating Odoo Addon Modules. You will need to add a state field to the LibraryBook model, defined as follows:
from odoo import models, fields, api class LibraryBook(models.Model): # [...] state = fields.Selection([('draft', 'Unavailable'), ('available', 'Available'), ('borrowed', 'Borrowed'), ('lost', 'Lost')], 'State')
Refer to the recipe Adding models in Chapter 4, Creating Odoo Addon Modules for more clarity.