Getting input from website users
In website development, often you need to create forms to take input from the website users (visitors). In this recipe, we will create an HTML form for the page for users to report issues related to books.
Getting ready
For this recipe, we will be using the my_library
module from the previous recipe. We will need a new model to store issues submitted by users.
So, before starting this recipe, modify the previous code:
- Add a field in the
library.book
model and the newbook.issues
model, as follows:class LibraryBook(models.Model): Â Â Â Â _name = 'library.book' Â Â Â Â name = fields.Char('Title', required=True) Â Â Â Â date_release = fields.Date('Release Date') Â Â Â Â author_ids = fields.Many2many('res.partner', string='Authors') Â Â Â Â image = fields.Binary(attachment=True) Â Â Â Â html_description...