[FIX] sale: multi-company conflict at reinvoicing

Since d88409e8e5ce77ff3ec3b24fcdc108d8df380994, taxes from different companies
are forbidden on sale.order.line records (which is the expected behavior).

Nonetheless, this highlighted some flows where the taxes were not properly
set/recomputed, especially re-invoicing, which is fixed by the current commit.

Fixes #123675

closes odoo/odoo#125434

X-original-commit: 6ce4019968bd0a1a11475910d35aa2ccfc2c6a9a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2023-06-16 23:01:14 +02:00
parent 3d44eb38d0
commit 71e10bc650
+2 -1
View File
@@ -155,7 +155,8 @@ class AccountMoveLine(models.Model):
last_sequence = last_so_line.sequence + 1 if last_so_line else 100
fpos = order.fiscal_position_id or order.fiscal_position_id._get_fiscal_position(order.partner_id)
taxes = fpos.map_tax(self.product_id.taxes_id)
product_taxes = self.product_id.taxes_id.filtered(lambda tax: tax.company_id == order.company_id)
taxes = fpos.map_tax(product_taxes)
return {
'order_id': order.id,