Pointer
Pointer

Reputation: 2186

Generate qweb report odoo 9

Is it possible to display a search sql statement output in QWEB report?

In popup I want add field date, quanatity after choose date and quantity on button click call "SELECT * FROM 123 WHERE date = field date AND quantity = field quantity.

Any simple solution?

Upvotes: 1

Views: 555

Answers (1)

gdaramouskas
gdaramouskas

Reputation: 3747

Yes it is.

For this you have to extend create a model that the template uses to fetch data and override the render_html method.

For an example of this take a look at addons/account_extra_reports/report/account_journal.py The docargs are the variables that will be available to you inside the template to use. See the _get_taxes method that performs and sql query and formats the data accordingly.

Upvotes: 0

Related Questions