Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
9045 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona