Openbravo Issue Tracking System - Retail Modules
View Issue Details
0032863Retail ModulesWeb POSpublic2016-05-04 17:262022-11-29 13:12
malsasua 
jorge-garcia 
highmajoralways
closedfixed 
5
pi 
 
marvintm
No
0032863: forbid to open two tabs in the same web browser with POS Terminal
if you open two tabs with POS terminal in the same browser, you can generate inconsistent data.

It should not be possible to open the two tabs or one message should be displayed when it happens.

It is possible although terminal authentication is enabled
in web POS:
. open tab1 URL:
https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1 [^]
. do login

. open a new tab, URL:
https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1 [^]
. do login
The main idea for the solution is to generate a unique id every time you access the application, save this id both in the local storage and in memory, and periodically compare both ids. If at some point these ids are different, it means that there has been a second version of the application opened in another tab.

So the changes necessary would be the following:
- When accessing the application, in ob-terminal-model, a unique random id should be generated. This id should be saved in the local storage, and in the terminal model itself (which is stored in memory).

- There should also be a periodic timeout (with reasonable interval, like 30 seconds), which compares the value of this id in the terminal object, with the one stored in local storage.

- If this timeout detects that the ids are different, then it needs to show a popup which should not be possible to close, and which explains to the user that there is already another tab open with the application.

It's very important to define a different id per application, because it should be possible to keep different applications open at the same time.
No tags attached.
related to defect 0047657 closed ranjith_qualiantech_com Errors when opening two POS tabs/windows on the same computer 
Issue History
2016-05-04 17:26malsasuaNew Issue
2016-05-04 17:26malsasuaAssigned To => Retail
2016-05-04 17:26malsasuaResolution time => 1464213600
2016-05-04 17:26malsasuaTriggers an Emergency Pack => No
2016-05-05 10:39OrekariaTypedefect => feature request
2016-05-05 10:39OrekariaStatusnew => acknowledged
2016-05-05 10:46marvintmProposed Solution updated
2016-05-26 15:45jorge-garciaStatusacknowledged => scheduled
2016-05-26 15:45jorge-garciaAssigned ToRetail => jorge-garcia
2016-05-27 08:52hgbotCheckin
2016-05-27 08:52hgbotNote Added: 0086774
2016-05-27 08:53hgbotStatusscheduled => resolved
2016-05-27 08:53hgbotResolutionopen => fixed
2016-05-27 08:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0ea26a5471e6b532393b1ecf3efe38b7789d1640 [^]
2016-06-14 11:53dmitry_mezentsevNote Added: 0087243
2016-06-15 19:14marvintmReview Assigned To => marvintm
2016-06-15 19:14marvintmStatusresolved => closed
2022-11-29 13:12alostaleRelationship addedrelated to 0047657

Notes
(0086774)
hgbot   
2016-05-27 08:52   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 0ea26a5471e6b532393b1ecf3efe38b7789d1640
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Thu May 26 17:28:58 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0ea26a5471e6b532393b1ecf3efe38b7789d1640 [^]

Fixed issue 32863: forbid to open two tabs in the same web browser with
POS Terminal

The solution has been applied for all the aplication:
* WebPOS
* Mobile Procurement
* Mobile Warehouse

Now, only the last aplication loaded will be unlocked to work.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0087243)
dmitry_mezentsev   
2016-06-14 11:53   
Not closed for 18 days!