Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
9044 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ