Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] account_invoice_fiscal_position_update wrong computation if B2C / B2B mapping. #1896

Open
legalsylvain opened this issue Jan 30, 2025 · 4 comments
Labels

Comments

@legalsylvain
Copy link
Contributor

legalsylvain commented Jan 30, 2025

Module

account_invoice_fiscal_position_update

Describe the bug

when fiscal position is mapping VAT Inc -> VAT Exc (or no vat), the computations of the prices are wrong.

As a result, select product then set fiscal position generates a differente invoice as select fiscal position then, select product.

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Configure a fiscal position with VAT excl -> VAT excl mapping and Vat INCL -> Vat Excl mapping.

(this is the case, by default with INTRA-EU B2B fiscal position installed by odoo l10n_fr localization).

Image

  1. Create 2 product, one with vat Incl and the other with vat Excl

Image

  1. Create an Invoice, add the two products. (The untaxed amount is 834.33)

Image

  1. Set the fiscal position. The Untaxed amount of the invoice changed. (Now 1001.00)

Image

Expected behavior

If we set first the fiscal position and then select product the result is the following, and is the good one. (834.33)

Image

@juancarlosonate-tecnativa

I can't find those taxes on products in Intra-EU B2B to reproduce the error. Did you configure them? Could you provide more details so i can check? thanks!

@legalsylvain
Copy link
Contributor Author

legalsylvain commented Feb 11, 2025

Hi @juancarlosonate-tecnativa. First thanks a lot for your answer !

Indeed, I had renamed the VAT to explain the bug, to be more explicit.

  • TTC means "INCLUDED in Price", in french
  • In l10n_fr, when "TTC" is NOT mentioned, it means "NOT INCLUDED in Price.

On a fresh instance, If I install l10n_fr then go on the fiscal position Intra-EU B2B, here are the original names :

Image

  • l10n_fr.tva_acq_normale : TVA 20% (Sales) (Goods)
  • l10n_fr.tva_acq_normale_TTC : TVA 20% TTC (Sales) (Goods)

don't hesitate to let me know if anything remains unclear!

@juancarlosonate-tecnativa

I can confirm the issue, this does happen. The problem seems to be with the price_unit, but i need to investigate further. Have you managed to find out anything else from a technical perspective? Thanks!

@legalsylvain
Copy link
Contributor Author

Hi. In V12, I had a similar problem with the following mappings : Excl -> Incl and Incl -> Incl. ("X -> Incl")
The problem was general in Odoo, and I solved it with that module :
https://github.com/grap/grap-odoo-incubator/tree/12.0/account_fiscal_position_tax_included

Now, here it is the Incl >> Excl that is failing. it is a more common case. (all B2C shops, that makes sometimes intracom sales are impacted).

Maybe the module account_invoice_fiscal_position_update should call this core function ?

https://github.com/odoo/odoo/blob/16.0/addons/account/models/account_tax.py#L1317

Thanks for your investigation !

StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

The standard behaviour of Odoo in case of tax excl. to tax incl. is to adjust
the subotal amount. This might not be what users expect. The same behaviour
is present in the function that this module provides.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

The standard behaviour of Odoo in case of tax excl. to tax incl. is to adjust
the subotal amount. This might not be what users expect. The same behaviour
is present in the function that this module provides.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

The standard behaviour of Odoo in case of tax excl. to tax incl. is to adjust
the subotal amount. This might not be what users expect. The same behaviour
is present in the function that this module provides.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
StefanRijnhart added a commit to StefanRijnhart/account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
rov-adhoc pushed a commit to adhoc-dev/oca-account-invoicing that referenced this issue Feb 17, 2025
Fixes OCA#1896

This change causes the subtotal amount to remain the same when a fiscal position
change triggers a tax update from tax included in price to tax excluded from
price.

Tests are added for conversion between tax excluded to tax included as well, but
in this case the behaviour is not 'fixed'. The standard behaviour of Odoo in
case of tax excl. to tax incl. is to adjust the subtotal amount. The same
behaviour is present in the function that this module provides. It might not
be what users expect, but it seems that Odoo does not support to preserve the
subtotal amount in this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants