Openbravo Issue Tracking System - Retail Modules
View Issue Details
0025091Retail ModulesWeb POSpublic2013-11-06 10:072013-12-20 13:14
alostale 
malsasua 
normalmajoralways
closedfixed 
5
 
RMP30 
guilleaer
No
0025091: Design defects in OB.UTIL.isDisableDiscount
Discounts entry in menu, which allows to apply discretionary discounts, is enabled/disabled based on:
-If there's no line in the ticket -> disable
-If there're lines and there are active discretionary discounts available to be applied -> enable

There are some issues in this logic (OB.UTIL.isDisableDiscount):
1. Incorrect handling of asynchronous DB query which results in always returning false regardless there are active discretionary discounts
2. Hardcoded list of promotions type to get the discretionary ones, OB.Model.Discounts.getManualPromotions() should be used instead
3. Excessive listening. All events in ticket and lines are observed to execute this logic, this should be revisited to reduce the number of events triggering it.
4. Too many queries to local DB, each time it is executed a new query is performed. Result should be cached to prevent it
Perform any action in the ticket and see how this function is executed
No tags attached.
Issue History
2013-11-06 10:07alostaleNew Issue
2013-11-06 10:07alostaleAssigned To => marvintm
2013-11-06 10:07alostaleTriggers an Emergency Pack => No
2013-11-11 13:32malsasuaAssigned Tomarvintm => malsasua
2013-12-05 15:40hgbotCheckin
2013-12-05 15:40hgbotNote Added: 0062608
2013-12-05 15:40hgbotStatusnew => resolved
2013-12-05 15:40hgbotResolutionopen => fixed
2013-12-05 15:40hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]
2013-12-05 17:06hgbotCheckin
2013-12-05 17:06hgbotNote Added: 0062610
2013-12-05 17:06hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal.cirque/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]
2013-12-05 17:21guilleaerNote Added: 0062626
2013-12-05 17:21guilleaerStatusresolved => closed
2013-12-05 17:27guilleaerStatusclosed => new
2013-12-05 17:27guilleaerResolutionfixed => open
2013-12-05 17:27guilleaerStatusnew => scheduled
2013-12-05 17:27guilleaerfix_in_branch => pi
2013-12-05 17:27guilleaerStatusscheduled => resolved
2013-12-05 17:27guilleaerResolutionopen => fixed
2013-12-05 17:48hgbotCheckin
2013-12-05 17:48hgbotNote Added: 0062655
2013-12-05 17:48hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal.cirque/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal-splitlines/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]
2013-12-18 13:30hgbotCheckin
2013-12-18 13:30hgbotNote Added: 0062777
2013-12-18 13:35guilleaerReview Assigned To => guilleaer
2013-12-18 13:35guilleaerNote Added: 0062779
2013-12-18 13:35guilleaerStatusresolved => closed
2013-12-18 13:35guilleaerFixed in Version => RMP30
2013-12-18 16:45hgbotCheckin
2013-12-18 16:45hgbotNote Added: 0062793
2013-12-19 18:19hgbotCheckin
2013-12-19 18:19hgbotNote Added: 0062889
2013-12-19 19:52hgbotCheckin
2013-12-19 19:52hgbotNote Added: 0062932
2013-12-19 19:52hgbotStatusclosed => resolved
2013-12-19 19:52hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal-splitlines/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal.offline/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]
2013-12-20 13:14guilleaerNote Added: 0062980
2013-12-20 13:14guilleaerStatusresolved => closed

Notes
(0062608)
hgbot   
2013-12-05 15:40   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 5c35cc0673c6437dbfe70db1db66b2c29d570d46
Author: Miguel A. Alsasua <miguel.alsasua <at> openbravo.com>
Date: Thu Dec 05 15:40:43 2013 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]

Fixed issue 25091: Design defects in OB.UTIL.isDisableDiscount

---
M web/org.openbravo.retail.posterminal/js/main.js
M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
---
(0062610)
hgbot   
2013-12-05 17:06   
Repository: erp/pmods/org.openbravo.retail.posterminal.cirque
Changeset: 5c35cc0673c6437dbfe70db1db66b2c29d570d46
Author: Miguel A. Alsasua <miguel.alsasua <at> openbravo.com>
Date: Thu Dec 05 15:40:43 2013 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal.cirque/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]

Fixed issue 25091: Design defects in OB.UTIL.isDisableDiscount

---
M web/org.openbravo.retail.posterminal/js/main.js
M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
---
(0062626)
guilleaer   
2013-12-05 17:21   
Reclosing
(0062655)
hgbot   
2013-12-05 17:48   
Repository: erp/pmods/org.openbravo.retail.posterminal-splitlines
Changeset: 5c35cc0673c6437dbfe70db1db66b2c29d570d46
Author: Miguel A. Alsasua <miguel.alsasua <at> openbravo.com>
Date: Thu Dec 05 15:40:43 2013 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal-splitlines/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]

Fixed issue 25091: Design defects in OB.UTIL.isDisableDiscount

---
M web/org.openbravo.retail.posterminal/js/main.js
M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
---
(0062777)
hgbot   
2013-12-18 13:30   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 4cb0a58b5bfa964e4d566d37b94727aad28f9802
Author: Guillermo Alvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Wed Dec 18 13:29:28 2013 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/4cb0a58b5bfa964e4d566d37b94727aad28f9802 [^]

related to issue 25091: listen just to the need events

---
M web/org.openbravo.mobile.core/source/component/ob-keyboard.js
---
(0062779)
guilleaer   
2013-12-18 13:35   
verified
(0062793)
hgbot   
2013-12-18 16:45   
Repository: erp/pmods/org.openbravo.mobile.core.cirque
Changeset: 4cb0a58b5bfa964e4d566d37b94727aad28f9802
Author: Guillermo Alvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Wed Dec 18 13:29:28 2013 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core.cirque/rev/4cb0a58b5bfa964e4d566d37b94727aad28f9802 [^]

related to issue 25091: listen just to the need events

---
M web/org.openbravo.mobile.core/source/component/ob-keyboard.js
---
(0062889)
hgbot   
2013-12-19 18:19   
Repository: erp/pmods/org.openbravo.mobile.core.offline
Changeset: 4cb0a58b5bfa964e4d566d37b94727aad28f9802
Author: Guillermo Alvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Wed Dec 18 13:29:28 2013 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core.offline/rev/4cb0a58b5bfa964e4d566d37b94727aad28f9802 [^]

related to issue 25091: listen just to the need events

---
M web/org.openbravo.mobile.core/source/component/ob-keyboard.js
---
(0062932)
hgbot   
2013-12-19 19:52   
Repository: erp/pmods/org.openbravo.retail.posterminal.offline
Changeset: 5c35cc0673c6437dbfe70db1db66b2c29d570d46
Author: Miguel A. Alsasua <miguel.alsasua <at> openbravo.com>
Date: Thu Dec 05 15:40:43 2013 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal.offline/rev/5c35cc0673c6437dbfe70db1db66b2c29d570d46 [^]

Fixed issue 25091: Design defects in OB.UTIL.isDisableDiscount

---
M web/org.openbravo.retail.posterminal/js/main.js
M web/org.openbravo.retail.posterminal/js/utils/ob-utilitiesuipos.js
---
(0062980)
guilleaer   
2013-12-20 13:14   
reclosed