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 printdoc_ids
is a list of the IDs of the records to printdoc_model
identifies the model of the records,todo.task
for exampletime
is is a reference to Python's time libraryuser
is the record for the user running the reportres_company
is the record for the current user's company
The report content is written in HTML, field values can be referenced using the t-field
attribute...