Skip to content
Snippets Groups Projects
Commit d470f2b4 authored by John (jol)'s avatar John (jol) Committed by John Laterre (jol)
Browse files

[REV] account: fix fiscal position with delivery address


This reverts the following commits:
- 164409b0
- f11c8072
- c92ebc91

The fix we initially made did not cover every possible scenario,
and applied to every fiscal position, which was not required.

It requires a more in depth rework that is under way
and will come in a future PR.

closes odoo/odoo#75238

X-original-commit: eba1f006
Signed-off-by: default avatarFlorian Gilbert <FlorianGilbert@users.noreply.github.com>
parent 24db93c0
Branches
Tags
No related merge requests found
......@@ -168,10 +168,11 @@ class AccountFiscalPosition(models.Model):
# This can be easily overridden to apply more complex fiscal rules
PartnerObj = self.env['res.partner']
partner = PartnerObj.browse(partner_id)
delivery = PartnerObj.browse(delivery_id)
# If partner and delivery have the same vat prefix, use invoicing
if not delivery or (delivery.vat and partner.vat and delivery.vat[:2] == partner.vat[:2]):
# if no delivery use invoicing
if delivery_id:
delivery = PartnerObj.browse(delivery_id)
else:
delivery = partner
# partner manually set fiscal position always win
......
......@@ -154,15 +154,3 @@ class TestFiscalPosition(common.SavepointCase):
mapped_taxes = self.fp2m.map_tax(self.src_tax)
self.assertEqual(mapped_taxes, self.dst1_tax | self.dst2_tax)
def test_30_fp_country_delivery(self):
"""
Customer is in Belgium
Delivery is in France
Check if fiscal position is France
"""
self.george.vat = False
self.assertEqual(
self.fp.get_fiscal_position(self.ben.id, self.george.id).id,
self.fr_b2c.id,
"FR B2C should be set")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment