diff options
| author | Anh Thao Pham (pta) <pta@odoo.com> | 2020-11-17 13:21:52 +0000 |
|---|---|---|
| committer | Anh Thao Pham (pta) <pta@odoo.com> | 2020-11-19 15:51:57 +0000 |
| commit | 9e244ae3053f46fc22b8e9a75015d57cd70053b8 (patch) | |
| tree | 3c5b51e3ec842688c99f9e9287513726a4d95444 /addons | |
| parent | 9f97b7435977c81a079004b7c2186ce75526490c (diff) | |
[FIX] account: fix 0% taxes shown on invoice print
- Install Invoicing
- Go to Invoicing > Configuration > Taxes
- Create a Tax 0% with its own tax group
- Go to Invoicing > Customers > Invoices
- Create an Invoice with a line having a normal Tax and several lines with Tax 0%
- Confirm and print Invoice
On the Subtotal section of the printed invoice, for the label of the Tax Group of Tax 0%,
only the amount of the first line having this tax is shown.
(i.e. "Tax 0% on $ XXX", where XXX should be the sum of all lines on which Tax 0% is applied)
opw-2381051
closes odoo/odoo#61856
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/account_move.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 1a4766fc957..6d9a2400e9a 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1486,11 +1486,13 @@ class AccountMove(models.Model): # At this point we only want to keep the taxes with a zero amount since they do not # generate a tax line. + zero_taxes = set() for line in move.line_ids: for tax in line.tax_ids.flatten_taxes_hierarchy(): - if tax.tax_group_id not in res: + if tax.tax_group_id not in res or tax.tax_group_id in zero_taxes: res.setdefault(tax.tax_group_id, {'base': 0.0, 'amount': 0.0}) res[tax.tax_group_id]['base'] += tax_balance_multiplicator * (line.amount_currency if line.currency_id else line.balance) + zero_taxes.add(tax.tax_group_id) res = sorted(res.items(), key=lambda l: l[0].sequence) move.amount_by_group = [( |
