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...