Getting ready

If you want to follow the recipe, ensure that you have the my_module addon from Chapter 4, Creating Odoo addon Modules, with the loan wizard defined in the Writing a wizard to guide the user recipe from Chapter 9, Advanced Server-Side Development Techniques.

Create a new addon module called library_loan_return_date that depends on my_module. In this module, extend the library.book.loan model, as follows:

class LibraryBookLoan(models.Model): 
    _inherit = 'library.book.loan' 
    expected_return_date = fields.Date('Due for', required=True) 

Extend the library.member model, as follows:

class LibraryMember(models.Model): 
    _inherit = 'library.member' 
    loan_duration = fields.Integer('Loan duration', 
                                   default=15, 
                                   required=True)

Since the expected_return_date field is required and no default is provided, the wizard to record loans will cease functioning because it does not provide a value for that field when it creates loans.

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

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