Extending web pages
Extensibility is a key design choice for the Odoo framework, and the Odoo web components are no exception. So, Odoo web controllers and templates can be also extended.
The Library app that we created in the previous Chapter 3, Your First Odoo Application, provided a book catalog page that now needs to be improved.
We will extend it to leverage the book availability information that was added by the Library Members module:
- On the controller side, we will add support to a query string parameter to filter only the available books; that is,
/library/books?available=1
. - On the template side, we will specify the books that are not available.
Let's start extending the web controller.
Extending the web controllers
Web controllers are responsible for handling web requests and rendering the page to return as a response. They should focus on presentation logic, not deal with business logic, which should be incorporated into model methods...