Skip to content
Snippets Groups Projects
Commit c1bbc53f authored by Nicolás Mac Rouillon's avatar Nicolás Mac Rouillon
Browse files

[FIX] sale_coupon & sale_coupon_delivery: Filter the taxes by company.


In this case for scenario with multi-company, the new line of the reward product, should be set with the taxes for company of the current sale order.
Before this change the taxes that are selected were for the all companies setted in the product.

closes odoo/odoo#63651

Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
parent 13773a92
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,7 @@ class SaleOrder(models.Model):
reward_qty = min(int(int(max_product_qty / program.rule_min_quantity) * program.reward_product_quantity), reward_product_qty)
# Take the default taxes on the reward product, mapped with the fiscal position
taxes = program.reward_product_id.taxes_id
taxes = program.reward_product_id.taxes_id.filtered(lambda t: t.company_id.id == self.company_id.id)
if self.fiscal_position_id:
taxes = self.fiscal_position_id.map_tax(taxes)
return {
......
......@@ -26,7 +26,7 @@ class SaleOrder(models.Model):
def _get_reward_values_free_shipping(self, program):
delivery_line = self.order_line.filtered(lambda x: x.is_delivery)
taxes = delivery_line.product_id.taxes_id
taxes = delivery_line.product_id.taxes_id.filtered(lambda t: t.company_id.id == self.company_id.id)
if self.fiscal_position_id:
taxes = self.fiscal_position_id.map_tax(taxes)
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment