diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-06-13 01:32:11 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-06-13 01:32:11 +0200 |
| commit | c5b299aadd3e6e8ffc0ca8d693bf3e2afd97ea66 (patch) | |
| tree | 867252bda8b5ee69ac8825d3e85c89b3101110c2 | |
| parent | 3856b7aa55dba040cf2422718b12be1a674dcc25 (diff) | |
| parent | 3832ad55822d183b74d376b09d4749b8c476dd63 (diff) | |
[MERGE] forward port branch saas-16 up to bba7db31386
| -rw-r--r-- | models/sale_order.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/sale_order.py b/models/sale_order.py index cba25817132..667489cfd47 100644 --- a/models/sale_order.py +++ b/models/sale_order.py @@ -273,10 +273,11 @@ class SaleOrderLine(models.Model): coupons_to_reactivate.write({'state': 'new'}) line.order_id.applied_coupon_ids -= coupons_to_reactivate # Remove the program from the order in the case it's still valid - related_program = self.env['sale.coupon.program'].search([('discount_line_product_id', '=', self.product_id.id)]) - if related_program: - self.order_id.no_code_promo_program_ids -= related_program - self.order_id.code_promo_program_id -= related_program + for line in self: + related_program = self.env['sale.coupon.program'].search([('discount_line_product_id', '=', line.product_id.id)]) + if related_program: + line.order_id.no_code_promo_program_ids -= related_program + line.order_id.code_promo_program_id -= related_program orders = self.mapped('order_id') res = super(SaleOrderLine, self).unlink() orders._recompute_coupon_lines() |
