Thomas Beckers e255c9e6e2 [FIX] account: Take into account caba origin in tax tag invert compute
Before, the tax tag invert is computed based on the entry type if the entry
type is different from "entry" or based on the tax set and the balance of aml
for entries with type "entry".

This is fine in most cases but we can reach a wrong tag invert if we use cash
basis and down-payment.

Here are the steps to reproduce:
- Create a company with cash basis tax (ex: "TVA 20% (Services)" for l10n_fr)
- Make sure no "base tax received account" is set in the cash basis settings
- Create a product with a cash basis default tax and an income account which is
not the default one
- Create an sale order with this product for 100€ + 20% tax
- Create a down payment for 30€ + 20% tax (add the tax to downpayment)
- Create the final invoice with deduction of down payment
- Register a payment on both to create the caba entries
=> Tax report will show 160€ of base instead of 100€

To have the issue, it's important that the income account of the product line
differs from the account used on the down payment line in the final invoice
because the issue involved having a negative base line  in the resulting caba
move. If the same account is used for invoice down/product line the caba base
lines will be grouped in one non negative line. For the same reason, the
"base tax received account" must remain empty.

The deduction aml on the cash basis entry of final invoice have an tag invert
at False instead of True. So it's computed as -30€ instead of +30€.

If we reproduce the case with a non cash basis tax, it will work because the
move type will be different from "entry" and tag invert will be computed only
based on the type.

To solve this issue, we now compute the tag invert based on caba origin move
if any to improve the tag invert computation for cash basis entries.

opw-3597141

closes odoo/odoo#152575

X-original-commit: d780a2fc73259244411329027349fad1cb353f34
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Thomas Beckers (tbs) <tbs@odoo.com>
2024-02-05 16:32:50 +00:00
2023-11-02 21:02:44 +00:00
2024-02-05 07:24:23 +00:00
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%