Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035199Openbravo ERPA. Platformpublic2017-02-07 14:522017-02-10 07:36
ngarcia 
caristu 
immediateminoralways
closedfixed 
5
 
3.0PR16Q3.63.0PR16Q3.6 
alostale
Core
Production - QA Approved
2016-04-18
3.0PR16Q3
http://code.openbravo.com/erp/devel/pi/rev/82f27ac1b1497b3a82646b140ab1b6e048f2b766 [^]
No
0035199: Cannot attach a document to an invoice if the role does not have access to ADTab entity and there is a module In Development
Cannot attach a document to an invoice if the role does not have access to ADTab entity and there is a module In Development

In upload function of AttachImplementationManager class the getTab function of the ApplicationDictionaryCachedStructures class is executed:

Tab tab = adcs.getTab(strTab);

There, if there exists a module In Development it is trying to return the Tab class:

    if (!useCache()) {
      // not using cache, initialize just current tab and go
      return OBDal.getInstance().get(Tab.class, tabId);
    }
As system admin role:
   Set a module In Development
Restart Tomcat

As group admin role:
   Create a new manual role
   Add access to F&B EspaƱa Region Norte organization
   Add editable access to Sales Invoice window
   Assign it to Openbravo user
   Log out and log in
   Change to the previously created role
   Go to Sales Invoice window, select a record and print it
   Select the option to attach it (Yes)
   Check the following error message is shown:

      "Entity ADTab is not readable by the user ..."

   The log shows:

org.openbravo.base.exception.OBSecurityException: Entity ADTab is not readable by the user 100
    at org.openbravo.dal.security.EntityAccessChecker.checkReadable(EntityAccessChecker.java:464)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:654)
    at org.openbravo.dal.service.OBDal.checkReadAccess(OBDal.java:641)
    at org.openbravo.dal.service.OBDal.get(OBDal.java:337)
    at org.openbravo.client.application.window.ApplicationDictionaryCachedStructures.getTab(ApplicationDictionaryCachedStructures.java:124)
    at org.openbravo.client.application.window.ApplicationDictionaryCachedStructures$Proxy$_$$_WeldClientProxy.getTab(ApplicationDictionaryCachedStructures$Proxy$_$$_WeldClientProxy.java)
    at org.openbravo.client.application.attachment.AttachImplementationManager.upload(AttachImplementationManager.java:119)
    at org.openbravo.erpCommon.utility.reporting.ReportManager.createAttachmentForReport(ReportManager.java:198)
    at org.openbravo.erpCommon.utility.reporting.ReportManager.createAttachmentForReport(ReportManager.java:165)
    at org.openbravo.erpCommon.utility.reporting.printing.PrintController.buildReport(PrintController.java:625)
    at org.openbravo.erpCommon.utility.reporting.printing.PrintController.post(PrintController.java:254)
    at org.openbravo.erpCommon.utility.reporting.printing.PrintInvoices.doPost(PrintInvoices.java:54)
No tags attached.
blocks defect 0035187 closed caristu Cannot attach a document to an invoice if the role does not have access to ADTab entity and there is a module In Development 
Issue History
2017-02-08 13:17caristuTypedefect => backport
2017-02-08 13:17caristuTarget Version => 3.0PR16Q3.6
2017-02-08 14:14hgbotCheckin
2017-02-08 14:14hgbotNote Added: 0094149
2017-02-08 14:14hgbotStatusscheduled => resolved
2017-02-08 14:14hgbotResolutionopen => fixed
2017-02-08 14:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q3.6/rev/7a2121e0e4571d77a130c10657a90cab09aa1ed1 [^]
2017-02-10 07:36alostaleReview Assigned To => alostale
2017-02-10 07:36alostaleNote Added: 0094198
2017-02-10 07:36alostaleStatusresolved => closed
2017-02-10 07:36alostaleFixed in Version => 3.0PR16Q3.6

Notes
(0094149)
hgbot   
2017-02-08 14:14   
Repository: erp/backports/3.0PR16Q3.6
Changeset: 7a2121e0e4571d77a130c10657a90cab09aa1ed1
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Feb 08 14:07:20 2017 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR16Q3.6/rev/7a2121e0e4571d77a130c10657a90cab09aa1ed1 [^]

fixes bug 35199: Can't attach using manual role having modules in indevelopment

It was not possible to attach a document with a role that hasn't got access to ADTab entity having modules in indevelopment. This was happening because when there are modules in indevelopemnt status, the getTab method of the ADCS class does not store the tab information in cache and uses DAL to retrieve the tab every time it is being called.

Under this circumstances, the getTab method in AttachImplementationManager must be invoked in admin mode to ensure that the role can generate the attachment even when not having access to the ADTab entity.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java
---
(0094198)
alostale   
2017-02-10 07:36   
code reviewed + tested