Commit Graph
11 Commits
Author SHA1 Message Date
Christophe Simonis 1e30dbe78e [MERGE] forward port branch saas-11.1 up to 6cb9ed4c424 2018-01-03 14:23:59 +01:00
qdp-odoo 5880d13384 [MERGE] forward port of branch saas-15 up to 59a505127b21b8dddc756a3f06d98a6165446288 2017-12-20 11:07:27 +01:00
Jeremy Kersten ee7928d4bc [FIX] website_sale_coupon: fix performance issue on cart update.
It was a bad idea to recompute_coupon_lines into the function 'sale_get_order'.
This function is called several times on each pages. The purpose of this one is
to return a browse record only and IF needed recompute more.
But apply a method that take several secondes will dramastically reduce the
ecommerce performance.

Now, we call the method only when we change the cart and so potentially change
the right to benefit of a coupon or not. And not at each call of the method
'sale_get_order'. In checkout, that reduce from 6 call on some page to one this
costly method that take several seconds.
2017-12-12 18:15:11 +01:00
Romain Derie 36512cc1b2 [REM] website_sale_coupon: Fields and file not used anymore
Since this commit https://github.com/odoo/enterprise/commit/87d542, these fields are not used anymore.
It needed to be removed in master.
2017-12-12 16:39:19 +01:00
Christophe Simonis 0fecd4b121 [MERGE] forward port branch saas-15 up to e9575185a57 2017-11-15 17:56:16 +01:00
rde 1bd44e1106 [FIX] website_sale_coupon: update reward line total when changing product qty on cart
- Add a product (imac 1.799$) and a promo code (eg: 10%) in your cart
  - Go to checkout (/shop/cart). You now see 1,619.10 Total and 179.90 discount
  - Change product qty (eg: 2)
  - Subtotal is now 2x 1.799 - 179.90 instead of 2x 1.799 - 2x 179.90
  - Reward line total (discount) is still the same amount (10% on 1 ipad)

Now, we will recompute the discount price based on the entire cart

Note: This behavior was wanted and comes from this commit #87d542
But for the shop, we need to have the reward line being updated on the fly or
it wont make sense for the end user.

This closes #ee4be7a532dd707a0cd19c766dc8e8537dcda242
2017-11-11 17:10:17 +01:00
Christophe Simonis d7c947b354 [MERGE] forward port branch saas-15 up to 6492adc3c4c 2017-06-27 13:45:01 +02:00
Yannick Tivisse 63c5b7c9c5 [FIX] sale_coupon: Don't update automatic rewards on the fly
Purpose
=======

Currently we are updating the coupon rewards on the fly when creating/modifying/deleting a sales order line.

To avoid multiple searches on res_partners and product to know whether the customer/product is valid on the sale coupon program, we store the applicable customers and products on the program according to the domain defined on it.

This brings 2 issues:
- The customers/products stored on the program are not updated (Was the original spec)
- The checks are numerous and maybe overkill for the given results

Specification
=============

- Don't recompute the reward lines on SO modifications. Add a button to compute the line by hand and make an automatic compute on the SO validation or on the page shop/payment.

- When recomputing the reward lines, make a search on the res_partners and products instead. Now that the action is not triggered so often we can afford to make a search.

- Don't use the fields rule_partners_domain and rule_products_domain. This should be removed in master.

- The field is_public_included is useless now. And we decided to make the coupon available for all the partners if they fit the domain on the program.
2017-06-21 15:55:27 +02:00
xmo-odoo bfca4119cd [FIX] implicitly relative imports 2017-04-28 09:07:28 +02:00
Yannick Tivisse e5ea41c835 [FIX] sale_coupon: Allow the public users to use the coupon mechanism 2017-01-31 10:31:37 +01:00
pgu-odoo c83cac4bfe [ADD] website_sale_coupon: Allow to use coupons in ecommerce 2016-12-20 14:48:01 +01:00