Openbravo Issue Tracking System - POS2
View Issue Details
0047215POS2POSpublic2021-06-23 09:222021-06-28 17:26
jmelin 
cberner 
highmajoralways
closedfixed 
30Openbravo Appliance 14.04
 
 
Pre packaging ( pi )
2021-03-16
https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/b8fde8a7bf3a7beece33da5cff38204b8f1f9493#a5ccd333ab96571c23fbd8439b70cb4cfdfaf04c_14_15 [^]
No
0047215: JIRA 2140 - Approval doesn't work in offline
When the POS is offline, it is not possible to approve an user action, even if the user uses to approve already approve on the POS and/or log in to the POS
Case 1
1. In BO, set an user action to "Require approval" for a user (User 1 below) and "Can use and approve" for an other (User 2)
2. Connect to POS with User 1
3. Try to do the action with approval
4. Enter User 2 credential to approve
5. Disconnect network from OB Central
6. Try to do the action with approval
7. Enter User 2 credential to approve
=> action can't be approve

Case 2
1. In BO, set an user action to "Require approval" for a user (User 1 below) and "Can use and approve" for an other (User 2)
2. Connect to POS with User 2 and log out
3. Connect to POS with User 1
4. Try to do the action with approval
5. Enter User 2 credential to approve
6. Disconnect network from OB Central
7. Try to do the action with approval
8. Enter User 2 credential to approve
=> action can't be approve
No tags attached.
depends on backport 0047222TAP closed cberner JIRA 2140 - Approval doesn't work in offline 
Issue History
2021-06-23 09:22jmelinNew Issue
2021-06-23 09:22jmelinAssigned To => Retail
2021-06-23 09:22jmelinTriggers an Emergency Pack => No
2021-06-23 11:26dmiguelezStatusnew => scheduled
2021-06-23 11:27dmiguelezResolution time => 1625608800
2021-06-23 11:27dmiguelezAssigned ToRetail => platform
2021-06-23 11:27dmiguelezStatusscheduled => acknowledged
2021-06-23 12:40alostaleNote Added: 0129738
2021-06-28 13:09cbernerAssigned Toplatform => cberner
2021-06-28 13:09cbernerStatusacknowledged => scheduled
2021-06-28 13:09cbernerRelationship deleteddepends on 0047256
2021-06-28 15:47hgbotNote Added: 0129859
2021-06-28 16:22cbernerRegression level => Pre packaging ( pi )
2021-06-28 16:22cbernerRegression date => 2021-03-16
2021-06-28 16:22cbernerRegression introduced by commit => https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/b8fde8a7bf3a7beece33da5cff38204b8f1f9493#a5ccd333ab96571c23fbd8439b70cb4cfdfaf04c_14_15 [^]
2021-06-28 17:26hgbotResolutionopen => fixed
2021-06-28 17:26hgbotStatusscheduled => closed
2021-06-28 17:26hgbotNote Added: 0129870
2021-06-28 17:26hgbotNote Added: 0129871

Notes
(0129738)
alostale   
2021-06-23 12:40   
Regression caused by Offline<->Online Transitions Integration [1].

Changed in ApprovalChecker.js [2]:

- const response = await OB.App.Request.mobileServiceRequest(
+ const response = await mobileServiceRequest(

The original threw exception if server is not available whereas the latter tries to handle it. Approval code is expecting this exception to handle offline.

---
[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/340 [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/b8fde8a7bf3a7beece33da5cff38204b8f1f9493#a5ccd333ab96571c23fbd8439b70cb4cfdfaf04c_14_15 [^]
(0129859)
hgbot   
2021-06-28 15:47   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/576 [^]
(0129870)
hgbot   
2021-06-28 17:26   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 7f67383e70ad7f773e6e5dcc7416ceb3b1231bd8
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-06-28T15:25:16+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/7f67383e70ad7f773e6e5dcc7416ceb3b1231bd8 [^]

Fixes ISSUE-47215: Approval doesn't work in offline

Approval fails because of a change in mobileServiceRequest. It was
previously throwing an exception, which was then used as reference to
start offline approval. Now it doesn't throw an exception, so the result
state is checked and if status is -1, offline approval is used instead.

---
M web-jspack/org.openbravo.core2/src/core/security/ApprovalChecker.js
M web-jspack/org.openbravo.core2/src/core/security/__test__/ApprovalChecker.test.js
---
(0129871)
hgbot   
2021-06-28 17:26   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/576 [^]