Anh Thao Pham (pta) abc44e8027 [FIX] account: prevent taxes on "payment_term" aml
Steps to reproduce:
- Go to Contacts and open any contact (e.g. Contact X)
- Check its configured Account Receivable (e.g. 121000 Account Receivable)
- Configure that account and set a default Sales tax on it (e.g. Tax 15%)
- Create an invoice with Contact X as customer
- Add an invoice line for any amount (e.g. $100) and any tax
- Swith to "Journal Items" tab and display "Taxes" column
A line (with 121000 Account Receivable) has been created automatically to balance the invoice line.
This line has a tax (i.e. Tax 15%): the default one configured on the account.
There should not be a tax for a receivable account.
Another issue is that the tax is set on the aml but not tax line has been created.
- Go back to "Invoice Lines" tab
- Remove the tax on the invoice line
- Save
In "Journal Items" tab, the tax line has been created from the aml with the receivable account.
- Go back to "Invoice Lines" tab
- Add a tax on the invoice line again
- Save
- Remove the tax on the invoice line
- Save
In "Journal Items" tab, there are now 2 tax lines from the aml with the receivable account.
By repeating the previous steps, new tax lines can be created infinitely.

Solution:
To prevent the issue, the default taxes shouldn't be populated on the aml when the account
is a receivable (or payable) one and when the move type is an "invoice" type one.
As "display_type" field of "account.move.line" is set to "payment_term" when the account is
a receivable or a payable one and when "is_invoice" is True on the move, no tax will be set
in "_compute_tax_ids" computed method when "display_type" is "payment_term".

opw-3345953

closes odoo/odoo#131330

X-original-commit: c6076a272cfe997856f3026557900ce9718c45e5
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-09 04:23:19 +02: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%