[FIX] account: fix fiscal position mapping in pos

Have a Fiscal position FPOS which map tax A to tax B
Have products DEMO with tax A and DEMO2
Allow FPOS in POS, Open a session, activate FPOS, sell DEMO and DEMO2
Close POS
Go to Orders, select the last one, hit return, edit, delete DEMO2 line

Tax will be wrong.
This occcur because the fiscal position mapping fail an equivalence
check with a virtual record, so the tax is calculated as A and not B

opw-2485399

closes odoo/odoo#69952

X-original-commit: 983797e626f742e84710de7ec8487824d6eaa7f1
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2021-04-27 17:27:04 +00:00
parent 90affa1301
commit cbdb4cb8aa
+1 -1
View File
@@ -71,7 +71,7 @@ class AccountFiscalPosition(models.Model):
return taxes
result = self.env['account.tax']
for tax in taxes:
taxes_correspondance = self.tax_ids.filtered(lambda t: t.tax_src_id == tax)
taxes_correspondance = self.tax_ids.filtered(lambda t: t.tax_src_id == tax._origin)
result |= taxes_correspondance.tax_dest_id if taxes_correspondance else tax
return result