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

Is there a possibility to make conditionals in the template depending on the current page that is being printed in Qweb reports?

e.g: <t t-if="page > 1"> do something that's on other pages except the first </t>

This was available in the header and footer section of report_webkit

Thanks

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

Did you finally get a way to detect the page number?

Câu trả lời hay nhất

page or topage (and other variables) are popolated by javascript in your report. When you put a <span class="page" /> in your report, a js function keep this values from url and put them in the right place. In particulare you can find this function in /addons/report/static/src/js/subst.js.

So it's impossibile to know the value of these variables in your qweb code.

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

check this question it may helps


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