summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavi Gadhia <rga@odoo.com>2018-07-10 13:53:06 +0200
committerSébastien Theys <seb@odoo.com>2018-07-17 13:13:15 +0200
commitefa70274cfb7134b3706d4e84dcc51189a67b2a6 (patch)
treed4a2c71a066241e45b2c330e740ccdfd30e44036
parent977e1dfe66c4c3b35a61d7fdfb88d522e814029c (diff)
[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
-rw-r--r--models/sale_coupon_program.py2
1 files changed, 1 insertions, 1 deletions
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