How to set qweb report table height if use "t-foreach" loop in odoo12 | Odoo [Link]
com/fr_FR/forum/aide-1/how-to-set-
Aide
Dismiss
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
CRM e-Commerce Comptabilité Inventaire PoS
Project management MRP
Take the tour
Aller à : Question
Recherche…
0
HILSHA votre adresse email... S'inscrire
27 mars 2020
1 sur 7
How to set qweb report table height if use "t-foreach" loop in odoo12 | Odoo [Link]
27 mars 2020
<table width="100%" border="0" style="height: 30%;border:1px
solid black;width:100%;">
i gave the table height and also tried with <div>
<div style="height:20mm;background-color:yellow;">
Commenter Partager
1 Commentaires
Sehrish - 18 août 2020
Working with tables in QWEB�
[Link]
[Link]
6 Réponses
2
Niyas Raphy Meilleure réponse
27 mars 2020
Hi,
See this sample inside the existing odoo code, in hr_attendance
module, the template for printing the employee badge,
2 sur 7
How to set qweb report table height if use "t-foreach" loop in odoo12 | Odoo [Link]
<t t-foreach="docs" t-as="employee">
<div class="col-md-6">
<table style="width:243pt; height:153pt; border: 1pt
solid black; border-collapse:separate; border-radius:8pt;
margin:5pt">
<td style="width:33%;" valign="center">
<table style="width:77pt; height:150pt">
<tr style="height:30%">
<td align="center" valign="center">
<img
t-if="employee.company_id.logo" t-att-
src="image_data_uri(employee.company_id.logo)" style="max-
height:45pt;max-width:90%" alt="Company Logo"/>
</td>
</tr>
<tr style="height:70%;">
<td align="center" valign="center">
<img t-if="[Link]" t-att-
src="image_data_uri([Link])" style="max-height:85pt;
max-width:90%" alt="Employee Image"/>
</td>
</tr>
</table>
</td>
<td style="width:67%" valign="center">
<table style="width:155pt; height:85pt">
<tr><th><div style="font-size:15pt;
margin-bottom:0pt;margin-top:0pt;" align="center"><t
t-esc="[Link]"/></div></th></tr>
<tr><td><div align="center" style="font-
size:10pt;margin-bottom:5pt;"><t
t-esc="employee.job_id.name"/></div></td></tr>
<tr><td><img alt="barcode"
3 sur 7
How to set qweb report table height if use "t-foreach" loop in odoo12 | Odoo [Link]
<tr><td><img alt="barcode"
t-if="[Link]" t-att-src="'/report/barcode/?type=%s&
amp;value=%s&width=%s&height=%s' % ('Code128',
[Link], 600, 120)" style="max-height:50pt;max-
width:100%;" align="center"/></td></tr>
</table>
</td>
</table>
</div>
</t>
Thanks
Commentaires Partager
2 Commentaires
HILSHA - 27 mars 2020
its all looks exactly like the old one,
The first raw of my table is the heading.2 nd row product with
invoices will all added up ,what to do to fix the height when
adding the products with the for loop
HILSHA - 27 mars 2020
sample code
<table width="100%" border="0" style="height:153mm;
border:1px solid black;width:100%;">
<tr style="font-family:Times New Roman;border:1px solid
black;padding: 3px;" width="100%">
4 sur 7
How to set qweb report table height if use "t-foreach" loop in odoo12 | Odoo [Link]
black;padding: 3px;" width="100%">
<td width="4%" align="center" style="font-family:Times New
Roman;border:1px solid black;padding: 3px;">
<b>S No</b>
</td>
<td valign="middle" width="39%" align="center" style="font-
family:Times New Roman;border:1px solid black;padding: 3px;">
<div>
<div>
<span style="padding-top:12px;padding-left:10px;float:
left;font-family:Times New Roman;font-size:11px;">
<b> Description</b>
</span>
<span style="padding-top:12px;padding-left:10px;float:
right;font-family:Times New Roman;font-size:11px;">
<b>. </b>
</span>
<div style="clear:both;"></div>
</div>
</div>
</td>
</tr>
<tr t-foreach="o.invoice_line_ids" t-as="l" style="font-
family:Times New Roman;border:1px solid black;padding:
5 sur 7
How to set qweb report table height if use "t-foreach" loop in odoo12 | Odoo [Link]
family:Times New Roman;border:1px solid black;padding:
8px;padding-top:8px;">
<td height="20" align="center" style="font-family:Times New
Roman;border:1px solid black;padding: 3px;">
<b>
<t t-esc="l_index+1"/>
</b>
</td>
<td align="left" style="font-family:Times New Roman;border:1px
solid black;padding: 3px;">
<b>
<t t-esc="l.product_id.name"/>
</b>
</td>
</tr>
</table>
4
MUHAMMAD Imran
27 mars 2020
it works with <table style="height:150mm;"> but not with <table
class="table table-condensed table-hover border"
style="height:150mm;">
Commentaires Partager
6 sur 7
How to set qweb report table height if use "t-foreach" loop in odoo12 | Odoo [Link]
Commentaires Partager
1 Commentaires
HILSHA - 27 mars 2020
I have not given the class to that table
Website made with
7 sur 7