odoo/enterprise#39244
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team for help in case of failure.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 1472s)
- label
- odoo-dev:saas-16.2-16.0-opw-3112197-is_refund-sesn-8H49-fw
- head
- 51a201307b9eb7dad5d8951642f85ab60b9d59a0
- merged
- 3 years ago by Accounting, Laurent Smet (las)
| odoo/odoo | odoo/enterprise | |
|---|---|---|
| 16.0 | #114801 | #39181 |
| saas-16.1 | #117523 | #39236 |
| saas-16.2 | #117533 | #39244 |
| 17.0 | ||
| 18.0 | ||
| saas-18.2 | ||
| saas-18.3 | ||
| saas-18.4 | ||
| 19.0 | ||
| master | #118588 | #39775 |
[FW][FIX] account_accountant: fix interaction between early payment discount and intra-community taxes
Bug
Currently, creating an intra-community bill and reconciling it with an early payment can break the tax report.
Steps to reproduce
- install the Austrian localization (l10n_at)
- set
Cash Discount Tax ReductiontoOn early payment - create a €1000 intra-community bill (you can just use the tax called
IGE 20%) - set the payment term to
2/7 Net 30and confirm - reconcile the bill with a payment within the discount period (2% discount: €980).
- check the Tax Report: line 5.4 of the report should be €196. If you reconciled the bill with a back statement directly, sections
Innergemeinschaftliche ErwerbandBemessungsgrundlagewill be wrong as well.
Cause
Since the intra-community applies here, the bill will produce two tax lines. And because Cash Discount Tax Reduction is set to On early payment, those two tax lines will be reduced when an early payment is made.
However, because of the way the is_refund property of account.move.line field is computed on moves of type entry, one of those tax reduction line will be considered a refund and the other will not. Furthermore, the computed tags are correct only because the taxes are recomputed again when creating the payment.
After removing this extra taxes computation, both tax_tag_ids/tax_tag_invert are invalid.
So the solution is to fix the method computing the taxes for cash discount lines.
Community PR: odoo/odoo#114801
Forward-Port-Of: #39181