Getting ready

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.27.45