Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
9025 Vizualizări

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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.

Imagine profil
Abandonează