Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027690Retail ModulesDiscounts and Promotionspublic2014-09-25 18:492014-10-02 17:00
jonalegriaesarte 
marvintm 
normalmajorhave not tried
closedfixed 
5
 
RR14Q4 
migueldejuana
No
0027690: Best deal case take too long in some cases
Best deal case take too long in some cases. It depends on the options to analyze due to the combos, packs included in the ticket.
Example of configuration:

2 x Combo 1 = 4 product a
4 product b
2 product c
1x product d
1x product e
1x product f

The application will freeze for at least 10 minutes before it goes to the next screen.
We can provide an environment where the configuration described takes some minutes to finish
No tags attached.
has duplicate defect 0031073 closed Retail when several combos are added to the receipt, chrome crash 
Issue History
2014-09-25 18:49jonalegriaesarteNew Issue
2014-09-25 18:49jonalegriaesarteAssigned To => marvintm
2014-09-25 18:49jonalegriaesarteResolution time => 1410472800
2014-09-25 18:49jonalegriaesarteTriggers an Emergency Pack => No
2014-09-25 18:53marvintmNote Added: 0070396
2014-09-25 19:01hgbotCheckin
2014-09-25 19:01hgbotNote Added: 0070397
2014-09-25 19:28hgbotCheckin
2014-09-25 19:28hgbotNote Added: 0070400
2014-09-25 19:31hgbotCheckin
2014-09-25 19:31hgbotNote Added: 0070401
2014-09-25 19:31hgbotStatusnew => resolved
2014-09-25 19:31hgbotResolutionopen => fixed
2014-09-25 19:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/d43b20a1455b593e64be0f0a3c1a17514e8d70b5 [^]
2014-09-25 20:26hgbotCheckin
2014-09-25 20:26hgbotNote Added: 0070408
2014-09-25 20:28hgbotCheckin
2014-09-25 20:28hgbotNote Added: 0070409
2014-10-02 17:00migueldejuanaReview Assigned To => migueldejuana
2014-10-02 17:00migueldejuanaNote Added: 0070666
2014-10-02 17:00migueldejuanaStatusresolved => closed
2014-10-02 17:00migueldejuanaFixed in Version => RR14Q4
2015-10-27 13:27marvintmRelationship addedhas duplicate 0031073

Notes
(0070396)
marvintm   
2014-09-25 18:53   
The cause of this problem is the pre filtering phase of the best deal case computation. This pre filtering will take too much time in case of a huge amount of potential combinations. Two changes will be implemented:
- Some performance improvements will be applied so that the pre filtering phase takes less time per combination checked.
- A maximum number of combinations to filter will be set, in case the organization has the preference defined to block the best deal case calculation in case the current ticket is too complex
(0070397)
hgbot   
2014-09-25 19:01   
Repository: erp/pmods/org.openbravo.retail.discounts.combo
Changeset: ceb6c471eb154b7bcd1212fe2fa7feb64ddcb98c
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Sep 25 18:58:48 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.combo/rev/ceb6c471eb154b7bcd1212fe2fa7feb64ddcb98c [^]

Related to issue 27690. Replace .each by normal for loop to reduce the number of function calls in the stack.

---
M web/org.openbravo.retail.discounts.combo/source/combo-rule-impl.js
---
(0070400)
hgbot   
2014-09-25 19:28   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 2385c117eb8bea9d9143d18ccf4e718493de2b2e
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Sep 25 19:27:40 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2385c117eb8bea9d9143d18ccf4e718493de2b2e [^]

Related to issue 27690. Increased max stack size to improve performance of findUsingCache method in ob-dal

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---
(0070401)
hgbot   
2014-09-25 19:31   
Repository: erp/pmods/org.openbravo.retail.discounts.bestdeal
Changeset: d43b20a1455b593e64be0f0a3c1a17514e8d70b5
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Sep 25 19:31:14 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/d43b20a1455b593e64be0f0a3c1a17514e8d70b5 [^]

Fixed issue 27690. Added check to stop the best deal case calculation in case the amount of prefiltered combinations is too big, and the 'stop long bdc' preference is set in the organization.

---
M web/org.openbravo.retail.discounts.bestdeal/source/discounts-best-deal-case.js
---
(0070408)
hgbot   
2014-09-25 20:26   
Repository: erp/pmods/org.openbravo.retail.discounts.bestdeal
Changeset: 360b4c3d0db813e6c050dc65aa1579bdf32423fe
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Sep 25 20:26:20 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/360b4c3d0db813e6c050dc65aa1579bdf32423fe [^]

Related to issue 27690. Changed the criteria to stop early. Now it's based on number of lines in combinations, to make it more accurate.

---
M web/org.openbravo.retail.discounts.bestdeal/source/discounts-best-deal-case.js
---
(0070409)
hgbot   
2014-09-25 20:28   
Repository: erp/pmods/org.openbravo.retail.discounts.bestdeal
Changeset: 6d395a649e19ddb369c3ff025d0793a9b1941dd8
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Sep 25 20:28:39 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bestdeal/rev/6d395a649e19ddb369c3ff025d0793a9b1941dd8 [^]

Related to issue 27690. Removed unneeded change.

---
M web/org.openbravo.retail.discounts.bestdeal/source/discounts-best-deal-case.js
---
(0070666)
migueldejuana   
2014-10-02 17:00   
Tested and reviewed in 7df701d05751