[FIX] sale, sale_layout : template crashing. Output pdf was unreadable due to colspan=100. Now using fixed number of column.

This commit is contained in:
Jérome Maes
2015-03-16 13:18:53 +01:00
parent 632ca11a94
commit 71c624163c
3 changed files with 17 additions and 15 deletions
+6 -6
View File
@@ -10,15 +10,15 @@
<div class="col-xs-6">
<strong t-if="doc.partner_shipping_id == doc.partner_invoice_id">Invoice and shipping address:</strong>
<strong t-if="doc.partner_shipping_id != doc.partner_invoice_id">Invoice address:</strong>
<div t-field="doc.partner_invoice_id"
<div t-field="doc.partner_invoice_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<p t-if="doc.partner_id.vat">VAT: <span t-field="doc.partner_id.vat"/></p>
<div t-if="doc.partner_shipping_id != doc.partner_invoice_id" class="mt8">
<strong>Shipping address:</strong>
<div t-field="doc.partner_shipping_id"
<div t-field="doc.partner_shipping_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<p t-if="doc.partner_id.vat">VAT: <span t-field="doc.partner_id.vat"/></p>
</div>
</div>
</div>
<div class="col-xs-5 col-xs-offset-1">
<div t-field="doc.partner_id"
@@ -58,8 +58,8 @@
<th>Description</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th groups="sale.group_discount_per_so_line">Disc.(%)</th>
<th>Taxes</th>
<th class="text-right"><span groups="sale.group_discount_per_so_line">Disc.(%)</span></th>
<th class="text-right">Taxes</th>
<th class="text-right">Price</th>
</tr>
</thead>
@@ -75,7 +75,7 @@
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td groups="sale.group_discount_per_so_line">
<td class="text-right" groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
</td>
<td>
@@ -20,8 +20,8 @@
<td class="text-right">
<span t-field="l.price_unit"/>
</td>
<td groups="sale.group_discount_per_so_line">
<span t-field="l.discount"/>
<td>
<span groups="sale.group_discount_per_so_line" t-field="l.discount"/>
</td>
<td>
<span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
@@ -53,8 +53,10 @@
<th>Description</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th groups="sale.group_discount_per_so_line">Disc.(%)</th>
<th>Taxes</th>
<th class="text-right"><!-- keep the column to keep a fix number for colspan -->
<span groups="sale.group_discount_per_so_line">Disc.(%)</span>
</th>
<th class="text-right">Taxes</th>
<th class="text-right">Price</th>
</tr>
</thead>
@@ -4,8 +4,8 @@
<template id="category_template">
<!-- Category name -->
<t t-if="p['category']">
<tr>
<td colspan="100" class="active" style="font-weight: bold; border-bottom: 1px solid black;">&amp;bull;
<tr class="active">
<td colspan="6" style="font-weight: bold; border-bottom: 1px solid black;">&amp;bull;
<t t-if="p['category'].name">
<t t-esc="p['category'].name"></t>
</t>
@@ -21,9 +21,9 @@
<!-- Subtotal -->
<t t-if="'subtotal' in p['category'] and p['category'].subtotal is True">
<tr class="text-right">
<td colspan="100">
<td colspan="6">
<strong>Subtotal: </strong>
<span t-esc="p['subtotal']" t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
<span t-esc="p['subtotal']" t-esc-options='{"widget": "monetary", "display_currency": "doc.currency_id"}'/>
</td>
</tr>
</t>
@@ -33,7 +33,7 @@
<!-- Separator -->
<t t-if="'separator' in p['category'] and p['category'].separator is True">
<tr class="text-center">
<td colspan="100">
<td colspan="6">
***
</td>
</tr>