diff options
| author | Nicolás Mac Rouillon <nmr@adhoc.com.ar> | 2020-12-21 14:52:04 +0000 |
|---|---|---|
| committer | Victor Feyens <vfe@odoo.com> | 2021-03-17 12:52:49 +0000 |
| commit | eb6ba44a6bfd0ebfce887edc307e0306765e5183 (patch) | |
| tree | e44cbdd78ba82657c2a49ae286735e6de6ec6a15 /addons/sale_coupon | |
| parent | 1efece5e44c2a69435184b98cb7a984acc881e90 (diff) | |
[FIX] 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#68014
X-original-commit: c1bbc53f5c61b3c6b99ad97e05407fd28b522046
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Diffstat (limited to 'addons/sale_coupon')
| -rw-r--r-- | addons/sale_coupon/models/sale_order.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/sale_coupon/models/sale_order.py b/addons/sale_coupon/models/sale_order.py index 365d95ee801..25a2334f211 100644 --- a/addons/sale_coupon/models/sale_order.py +++ b/addons/sale_coupon/models/sale_order.py @@ -99,7 +99,8 @@ 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 = self.fiscal_position_id.map_tax(program.reward_product_id.taxes_id) + taxes = program.reward_product_id.taxes_id.filtered(lambda t: t.company_id.id == self.company_id.id) + taxes = self.fiscal_position_id.map_tax(taxes) return { 'product_id': program.discount_line_product_id.id, 'price_unit': - price_unit, |
