[FIX] sale: do not display negative discount

opw-1903225

closes odoo/odoo#29829
This commit is contained in:
Nicolas Martinelli
2018-12-31 11:02:23 +00:00
parent 012eefcf3e
commit ea003d6c9a
+2 -1
View File
@@ -460,6 +460,7 @@
</td>
<td t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<div
t-if="line.discount &gt;= 0"
t-field="line.price_unit"
t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'
t-att-style="line.discount and 'text-decoration: line-through' or None"
@@ -470,7 +471,7 @@
</div>
</td>
<td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<strong t-if="line.discount" class="text-info">
<strong t-if="line.discount &gt; 0" class="text-info">
<t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>% discount
</strong>
</td>