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_inter_company : partner_shipping_id propagation leads to wrong fiscal position #651

Closed
metaminux opened this issue Jun 25, 2024 · 1 comment
Labels

Comments

@metaminux
Copy link
Contributor

I think we shouldn't propagate the partner_shipping_address field in supplier invoices

Module

account_invoice_inter_company

Describe the bug

As of 44a3178 the partner_shipping_id field is propagated from the customer invoice of company A to the inter company Vendor Bill of company B
But shipping address is used in invoices to compute the fiscal position (see https://github.com/odoo/odoo/blob/54f84aedf8da14f4f3298febc44c4fec103e3a47/addons/account/models/account_move.py#L773-L781), leading to wrong tax rates

To Reproduce

16.0:

Steps to reproduce the behavior:

  1. Create a brand new database with demo data
  2. Install module account_invoice_inter_company
  3. Install module sale to be sure partner_shipping_id field exists in invoice
  4. Install module l10n_fr with demo data (to get a french company with fiscal position and taxes already set)
  5. Select the main company YourCompany
  6. Create a customer invoice with FR Company as customer
  7. Add a product (for example E-COM07, qty = 1, unit price $320)
  8. Confirm the invoice

Current behavior
The generated inter company Supplier Bill from YourCompany (San Francisco) in FR Company company has a fiscal position EU privé (which is wrongly computed from FR Company partner in partner_shipping_id field in the FR Company company context)
This leads to a VAT 20% rate and a total amount of $384 USD
A message is created in the chatter to inform that the total amount is different from the original inter company invoice...

Expected behavior
The generated inter company Supplier Bill from YourCompany (San Francisco) in FR Company company has a fiscal position Import/Export Hors Europe + DOM-TOM (which is the right position for exportation from US to France)
This leads to a Export 0% rate and a total amount of $320 USD

Additional context

  • by default, tax rate computed in customer invoice for France is 15% which I think is wrong but is not relevant here
  • as account_invoice_inter_company doesn't depend on sale, I'm not sure how to proceed to write a relevant test for this use case
  • i will create a PR to remove the propagation
@metaminux metaminux added the bug label Jun 25, 2024
@metaminux
Copy link
Contributor Author

cc @Kev-Roche

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

1 participant