Presenting data in reports

Unlike Kanban views, the QWeb templates in reports are rendered server side, and use a Python QWeb implementation. We can see this as two implementations of the same specification, and there are some differences that we need to be aware of.

To start with, QWeb expressions are evaluated using Python syntax, not JavaScript. For the simplest expressions, there may be little or no difference, but more complex operations will probably be different.

The way expressions are evaluated is also different. For reports, we have the following variables available:

  • docs is an iterable collection with the records to print
  • doc_ids is a list of the IDs of the records to print
  • doc_model identifies the model of the records, todo.task for example ...

Get Odoo 10 Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.