From efa70274cfb7134b3706d4e84dcc51189a67b2a6 Mon Sep 17 00:00:00 2001 From: Ravi Gadhia Date: Tue, 10 Jul 2018 13:53:06 +0200 Subject: [PATCH] [IMP] various: improve section and add note on sale order and invoice Enterprise counterpart of this commit: https://github.com/odoo/odoo/commit/762adedece1c6c2b97b282348659c1b39b988d24 In enterprise the commit will also remove most of the features of website_quote_subscription because they became obsolete with the ability to create sections. Indeed the feature was to automatically regroup recurring subscriptions in a "section" at the bottom of the documents. Now if the sale persons want that behavior they can just create an actual section. Task #53996 PR #2276 --- models/sale_coupon_program.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/sale_coupon_program.py b/models/sale_coupon_program.py index 740a32b9506..e1dc4dda53e 100644 --- a/models/sale_coupon_program.py +++ b/models/sale_coupon_program.py @@ -214,7 +214,7 @@ class SaleCouponProgram(models.Model): i.e Buy 1 imac + get 1 ipad mini free then check 1 imac is on cart or not or Buy 1 coke + get 1 coke free then check 2 cokes are on cart or not """ - order_lines = order.order_line - order._get_reward_lines() + order_lines = order.order_line.filtered(lambda line: line.product_id) - order._get_reward_lines() products_qties = dict.fromkeys([product for product in order_lines.mapped('product_id')], 0) for line in order_lines: products_qties[line.product_id] += line.product_uom_qty