Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5202 มุมมอง

Hi,

I want to add JavaScript in my Qweb Report but unable to find a solution.

What i tried

1. Through Assests common reports

2. Buy adding <script> tag inside report

3. by adding the parameter (--run-script <js> ) in _run_wkhtmltopdf() in ir_actions_report.py file

But nothing is working.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Muhammad Awais,

To run Javascript in qweb normally we are using following code in qweb reports,

<script>

function subst () {

// WRITE YOUR JAVA SCRIPT CODE HERE IN FUNCTION

}

</script>

so when the report template will render this code will execute,

Thanks ...

For more information Contact us:- https: //kanakinfosystems.com/odoo-development-services 

อวตาร
ละทิ้ง
ผู้เขียน

I already tried this, but it is not working.

can you share a little bit of code of your template, how exactly you write the code?

Hi Neha,
Is there any possibility to detect if any element is missing in a page through js code in qweb pdf report ? My requirement is when it auto breaks the rows of a table the next page won't have the table header. Can I add table header to the page if it is missing the header ?

Related Posts ตอบกลับ มุมมอง กิจกรรม
Qweb decimal point in reports แก้ไขแล้ว
6
ก.ค. 22
40057
1
ม.ค. 24
1090
Repeat Header On Every Page In Report แก้ไขแล้ว
1
พ.ค. 24
13117
3
พ.ย. 20
10887
4
ส.ค. 20
5337