Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,15 @@ def update_product_taxes(self, product, taxes_field, company_from):
self.new_company_id.id, product_taxes
)
if tax_ids:
product.update({taxes_field: [Command.link(tax_id) for tax_id in tax_ids]})
to_unlink_taxes = product[taxes_field].filtered(
lambda tax: tax.company_id == self.new_company_id
)
product.update(
{
taxes_field: [Command.unlink(t.id) for t in to_unlink_taxes]
+ [Command.link(tax_id) for tax_id in tax_ids]
}
)
return True
return False

Expand Down