Skip to Content
Menu
This question has been flagged
1 Reply
8118 Views

how can i get the name or the ID of the current report within template (xml)?

my goal is to handle some things depending on the report in the web.external_layout_standard

with o._name i can get the model but i also need to know which exact report was called.

Avatar
Discard
Best Answer

In the QWeb Report you can use one of these variables and search the data you need:

External Identifier (ir.ui.view): <span t-esc="xmlid"/>

Database ID (ir.ui.view): <span t-esc="viewid"/>

Name of the report:  <span t-esc="env['ir.actions.report'].search([('report_name', '=', xmlid)]).name"/>

I hope this can help you.

Avatar
Discard