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

If I try to make a table for an email and use a loop in it:

<table>

<tr>

<th>Column1</th>

<th>Column1</th>

</tr>

% for comp in object.component_ids:

<tr>

<td>${data1}</td>

<td>${data2}</td>

</tr>

% endfor

</table>

And as soon as I save it, Odoo takes the % for and % endfor out of my table and puts them front of the <table>. Any idea why?


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

Change the widget_html to widget_text... it should works :)


It is because the browser auto correct the html... and it is no valid to have node text between <tr> tag


 

อวตาร
ละทิ้ง

please can you explain where can you change the widget?

@Magen

Enable debug mode in setting, go to the view you want to update

At top right click on the bug icon -> edit form -> replace widget='html_frame' by widget='text" for the body field

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 25
1151
0
ม.ค. 25
3196
1
ส.ค. 23
14462
change password แก้ไขแล้ว
1
ส.ค. 23
13151
4
เม.ย. 23
10202