O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating or modifying templates - QWeb

We'll add website capabilities to the library addon developed in Chapter 4, Application models, and following. What we're interested in is allowing users to browse through the library and, if they are logged in with the appropriate permissions, enable them to edit book content right from the website interface.

Getting ready

As we make use of the library.book model, get chapter 4's code for my_module. For convenience, this recipe's code contains a copy of it.

How to do it...

We'll need to define a couple of controllers and views:

  1. Add a template that displays a list of books in views/library_book_templates.xml.
    <odoo> <template id="books"> <t t-call="website.layout"> <section> This is an editable text before the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required