Openbravo Issue Tracking System - POS2
View Issue Details
0050221POS2POSpublic2022-09-12 11:052022-09-12 11:47
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
22Q4 
No
0050221: Coupon Delivery Control Method does not work
In pos2 standard without custom overrides the coupon delivery control method results in a javascript error [1]


[1]
Uncaught (in promise) DOMException: Failed to execute 'put' on 'IDBObjectStore': #<Promise> could not be cloned.
    at https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/8.efb9cf6e.chunk.js:1:118123 [^]
    at Array.forEach (<anonymous>)
    at OB.App.Class.IndexedDBController.write (https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/8.efb9cf6e.chunk.js:1:118106 [^])
    at OB.App.Class.IndexedDBController.put (https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/8.efb9cf6e.chunk.js:1:117969 [^])
    at Object.put (https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/8.efb9cf6e.chunk.js:1:174097 [^])
    at OB.App.Class.SynchronizationBuffer.onMessagesChanged (https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/8.efb9cf6e.chunk.js:1:175822 [^])
    at https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/8.efb9cf6e.chunk.js:1:112480 [^]
    at Array.forEach (<anonymous>)
    at OB.App.Class.PersistenceChangeListenerManager.handleChange (https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/8.efb9cf6e.chunk.js:1:112445 [^])
    at Object.m [as dispatch] (https://restaurant-demo.services.openbravo.com/openbravo/web/pos/static/js/12.3f0ae5b0.chunk.js:2:111818 [^])
Set a delivery control method as coupon, or print a coupon when the pager does not work because the pager is not connected.

The error occurs because the system passes an unresolved promise in the message which is stored in to the messagebuffer. The messagebuffer tries to persist itself but promises can not be persisted.
Remove the word async here [1], it is not needed

[1]
https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/core/pickupPoint/deliveryControl/coupon/CouponDeliveryControlMethod.js#L35 [^]
No tags attached.
Issue History
2022-09-12 11:05mtaalNew Issue
2022-09-12 11:05mtaalAssigned To => mtaal
2022-09-12 11:05mtaalTriggers an Emergency Pack => No
2022-09-12 11:46hgbotNote Added: 0141013
2022-09-12 11:47hgbotResolutionopen => fixed
2022-09-12 11:47hgbotStatusnew => closed
2022-09-12 11:47hgbotFixed in Version => 22Q4
2022-09-12 11:47hgbotNote Added: 0141014
2022-09-12 11:47hgbotNote Added: 0141015

Notes
(0141013)
hgbot   
2022-09-12 11:46   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1194 [^]
(0141014)
hgbot   
2022-09-12 11:47   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 8a897e2563d5cdc41d4356aceb70e0a5d8bf4278
Author: Martin Taal <martin.taal@openbravo.com>
Date: 12-09-2022 11:45:48
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/8a897e2563d5cdc41d4356aceb70e0a5d8bf4278 [^]

Fixed ISSUE-50221: remove not needed async keyword to allow saving in the message buffer'

---
M web-jspack/org.openbravo.pos2/src/core/pickupPoint/deliveryControl/coupon/CouponDeliveryControlMethod.js
---
(0141015)
hgbot   
2022-09-12 11:47   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1194 [^]