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

How to add a field on a report only if a box is checked?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hi Team,

In some cases, your client would like to see an information on the SO only if a box is checked. 

Here is the solution:

1) Add a checkbox field on the model sale.order: x_appear

2) On the report Qweb view related to this model, you should add a "t-if" on the field you want to see or not on the report (with a xpath, of course)

Here is an example for the Margin (and other fields my clients wanted to see (report below the code):

       

t-if="doc.x_appear">

       

         

             

             

             

             

           

 

           

             

             

           

           

             

             

           

         

                Total Cost:

             

               

             

                Margin:

             

               

             

                Margin%:

             

                %

             

       

       

   


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 21
3816
PDF reports แก้ไขแล้ว
5
ก.ค. 25
2163
Wrong PDF Format แก้ไขแล้ว
2
มี.ค. 24
2701
2
พ.ค. 23
3107
0
พ.ย. 22
2907