Openbravo Issue Tracking System - POS2
View Issue Details
0050629POS2Corepublic2022-10-25 12:132022-10-25 12:13
cberner 
Triage Platform Base 
normalmajorhave not tried
newopen 
5
 
 
No
0050629: You may not call store.getState() error when calling OB.error from discount comparator engine
An error appears related with TerminalLog state action being called from inside another state action. "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store."

This is due to calling OB.error from inside comparator-evaluator.js file in discounts.propertycondition module: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts.propertycondition/-/blob/master/web/org.openbravo.discounts.propertycondition/js/engine/comparator-evaluator.js#L23 [^]

This call to OB.error fails with the attached gif when it is called as part of the Ticket modelhooks, which recalculate totals and discounts.
1. Login backoffice and go to discounts and promotions
2. Add a CRM Property Condition with a not supported reference. This can be achieved by creating a new comparator in Comparator window(as system admin), or by changing one of the CRM Properties in CRM Configuration window to have reference Autocomplete(currently not supported)
3. Login WebPOS and refresh masterdata
4. Try to add any product and see that you get extra errors
Try not to execute OB.error from inside other actions, maybe we can use a "throw new Error" instead of OB.error in this particular case.
No tags attached.
related to feature request 0050626 closed yogaskarnik Autocomplete CRM reference properties are not supported for discounts & promotions property/condition 
gif error storeGetStore.gif (1,094,575) 2022-10-25 12:13
https://issues.openbravo.com/file_download.php?file_id=17706&type=bug
png callStack getState.png (108,490) 2022-10-25 12:13
https://issues.openbravo.com/file_download.php?file_id=17707&type=bug
png
Issue History
2022-10-25 12:13cbernerNew Issue
2022-10-25 12:13cbernerAssigned To => Triage Platform Base
2022-10-25 12:13cbernerFile Added: error storeGetStore.gif
2022-10-25 12:13cbernerTriggers an Emergency Pack => No
2022-10-25 12:13cbernerFile Added: callStack getState.png
2022-10-25 15:49rafarodaRelationship addedrelated to 0050626

There are no notes attached to this issue.