Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
9027 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar