April 2019
Beginner to intermediate
774 pages
24h 59m
English
For a an easier to understand, we will add a new model to manage the book ratings. We will add a new model called library.book.rent. You can refer to the following definition to add this model:
class LibraryBookRent(models.Model): _name = 'library.book.rent' book_id = fields.Many2one('library.book', 'Book', required=True) borrower_id = fields.Many2one('res.partner', 'Borrower', required=True) state = fields.Selection([('ongoing', 'Ongoing'), ('returned', 'Returned')], 'State', default='ongoing', required=True) book_id = fields.Many2one('library.book', 'Book', required=True) rent_date = fields.Date(default=fields.Date.today) return_date = fields.Date()
You will need to add a form view, an action, and a menu item to see this new ...
Read now
Unlock full access