Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043624Retail ModulesWeb POSpublic2019-12-13 09:022020-04-23 17:21
kchoperena 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
 
RR19Q4.4RR19Q4.4 
marvintm
No
0043624: It is needed a setAdminMode(true) in isCrossStoreEnabled method of POSUtils.java
It is needed an OBContext.setAdminMode(true) in isCrossStoreEnabled of POSUtils.java because the Category.java is calling through the getQuery method and blocks the login of the WebPOS with some user configuration because the Organization entity is not directly readable.
It happens with users not configured as admin that do not have access to Organization entity and also have a role configured as manual.
1.- Config a user in the back-end without admin permissions
2.- Assign to the user a role that is manual
3.- Remove from the role the Window Access of the 'Organization' entity.
4.- Try to do a login with the user in the Web POS


EXPECTED RESULT:
The next error should appear in the console log:

2019-12-13 08:55:13,104 [http-nio-8080-exec-1] ERROR org.openbravo.mobile.core.process.ProcessHQLQuery - org.openbravo.retail.posterminal.master.Category: Error when generating query: null (Entity Organization is not directly readable, only id and identifier properties are readable, property Organization.oBRETCOCrossStoreOrganization is neither of these.)
org.openbravo.base.exception.OBSecurityException: Entity Organization is not directly readable, only id and identifier properties are readable, property Organization.oBRETCOCrossStoreOrganization is neither of these.
    at org.openbravo.base.structure.BaseOBObject.checkDerivedReadable(BaseOBObject.java:291) ~[classes/:?]
    at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:252) ~[classes/:?]
    at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:229) ~[classes/:?]
    at org.openbravo.base.structure.BaseOBObject.get(BaseOBObject.java:210) ~[classes/:?]
    at org.openbravo.model.common.enterprise.Organization.getOBRETCOCrossStoreOrganization(Organization.java:2201) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
    at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept(ByteBuddyInterceptor.java:56) ~[hibernate-core-5.4.2.Final.jar:5.4.2.Final]
    at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:95) ~[hibernate-core-5.4.2.Final.jar:5.4.2.Final]
    at org.openbravo.model.common.enterprise.Organization$HibernateProxy$d75QZZ5l.getOBRETCOCrossStoreOrganization(Unknown Source) ~[classes/:?]
    at org.openbravo.retail.posterminal.POSUtils.isCrossStoreEnabled(POSUtils.java:963) ~[classes/:?]
    at org.openbravo.retail.posterminal.master.Category.getQuery(Category.java:80) ~[classes/:?]
No tags attached.
blocks defect 0042548 closed ranjith_qualiantech_com It is needed a setAdminMode(true) in isCrossStoreEnabled method of POSUtils.java 
Issue History
2020-03-31 16:32marvintmTypedefect => backport
2020-03-31 16:32marvintmTarget Version => RR19Q4.4
2020-04-01 09:51hgbotCheckin
2020-04-01 09:51hgbotNote Added: 0118901
2020-04-01 09:51hgbotStatusscheduled => resolved
2020-04-01 09:51hgbotResolutionopen => fixed
2020-04-01 09:51hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/07ca401643257350698cfc0bb54e655a813ce796 [^] => http://code.openbravo.com/retail/backports/3.0RR19Q4.4/org.openbravo.retail.posterminal/rev/6dd8ee48d241614c4100de061305d67522e0a6b3 [^]
2020-04-23 17:21marvintmReview Assigned Tojorge-garcia => marvintm
2020-04-23 17:21marvintmStatusresolved => closed
2020-04-23 17:21marvintmFixed in Version => RR19Q4.4

Notes
(0118901)
hgbot   
2020-04-01 09:51   
Repository: retail/backports/3.0RR19Q4.4/org.openbravo.retail.posterminal
Changeset: 6dd8ee48d241614c4100de061305d67522e0a6b3
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Apr 01 13:21:10 2020 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR19Q4.4/org.openbravo.retail.posterminal/rev/6dd8ee48d241614c4100de061305d67522e0a6b3 [^]

Fixed issue-43624 : Added AdminMode to isCrossStoreEnabled method in POSUtils

---
M src/org/openbravo/retail/posterminal/POSUtils.java
---