[FIX] account, sale: Incorrect tax description in SO/invoice with tax group

Displaying the amount base for tax group with several lines in sale or invoice
report is too complex to manage. For example before the fix, using a group tax GT
with two excluded taxes(T1, T2) displayed the sum of the base of T1 and the sum of
the base of T2 which was completely wrong. But for a GT with an included tax affecting the amount
base T3 and an excluded tax T4, it 's not possible to display the common amount base for the tax group
because the base of T3 is not equal of the base of T4.

opw:804014
This commit is contained in:
Goffin Simon
2018-01-18 16:14:27 +01:00
parent 9954d242d4
commit 66a95d91aa
2 changed files with 11 additions and 8 deletions
+6 -6
View File
@@ -112,18 +112,18 @@
<t t-foreach="o._get_tax_amount_by_group()" t-as="amount_by_group">
<tr style="border-bottom:1px solid #dddddd;">
<t t-if="len(o.tax_line_ids) == 1 and o.amount_untaxed == amount_by_group[2]">
<td><span t-esc="amount_by_group[0]"/></td>
<td class="text-right">
<span t-esc="amount_by_group[3]"/>
</td>
</t>
<t t-else="">
<td>
<span t-esc="amount_by_group[0]"/>
<span>&amp;nbsp;<span>on</span>
<t t-esc="amount_by_group[4]"/>
</span>
</td>
<td class="text-right">
<span t-esc="amount_by_group[3]"/>
</td>
</t>
<t t-else="">
<td><span t-esc="amount_by_group[0]"/></td>
<td class="text-right">
<span t-esc="amount_by_group[3]" />
</td>
+5 -2
View File
@@ -150,7 +150,10 @@
<t t-foreach="doc._get_tax_amount_by_group()" t-as="amount_by_group">
<tr style="border-bottom:1px solid #dddddd;">
<t t-if="amount_by_group[3] == 1 and doc.amount_untaxed == amount_by_group[2]">
<td><span t-esc="amount_by_group[0]"/></td>
<td>
<span t-esc="amount_by_group[0]"/>
<span>&amp;nbsp;<span>on</span>&amp;nbsp;<t t-esc="amount_by_group[2]" t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/></span>
</td>
<td class="text-right">
<span t-esc="amount_by_group[1]"
t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/>
@@ -158,7 +161,7 @@
</t>
<t t-else ="">
<td>
<span t-esc="amount_by_group[0]"/><span>&amp;nbsp;<span>on</span>&amp;nbsp;<t t-esc="amount_by_group[2]" t-options='{"widget": "monetary", "display_currency": doc.pricelist_id.currency_id}'/></span>
<span t-esc="amount_by_group[0]"/>
</td>
<td class="text-right">
<span t-esc="amount_by_group[1]"