Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022131Openbravo ERP01. General setuppublic2012-10-29 11:182012-11-20 20:53
caristu 
shankarb 
urgentmajoralways
closedfixed 
5
pi 
3.0MP183.0MP18 
dbaz
OBPS
Core
17688
No
0022131: AD_Tab_Access for inactive tabs is causing javascript errors
If we mark as inactive a tab that is included in the tab_access for a particular role causes the following error when accessing to the window that includes the tab: "Cannot read property 'viewForm' of null"

In same cases this error prohibits the access to the window when accessing a second time.
- As group admin role, go to the [Role] window
- Create a record in [Window Access] tab for an specific role (i.e Sales Role) and for an specific window (i.e Business Partner).
- Add a record in [Tab Access] window for any tab in Business Partner Window (i.e Customer)
- Go as a System Administrator and set Active = 'N' for the tab Customer in Business Partner Window.
- Log in as Sales Role and navigate to the Business Partner Window. The following javascript error is thrown (use Google Chrome Developer Tools): "Uncaught TypeError: Cannot read property 'viewForm' of null "
This error is caused in the following line of the ob-standard-window.js file:

for (i = 0; i < view.viewForm.getFields().length; i++) {

view in null, because we are assigning its value with the following statement:

view = this.getView(tab.tabId);

we can't get the tab view because is set as inactive.

This problem is solved if we just add a condition to check if view is null before accesing to its fields:

if (view != null){
  for (i = 0; i < view.viewForm.getFields().length; i++) {
  ....
  
}
No tags attached.
diff FixIssue22131.diff (4,550) 2012-11-08 14:34
https://issues.openbravo.com/file_download.php?file_id=5716&type=bug
Issue History
2012-10-29 11:18caristuNew Issue
2012-10-29 11:18caristuAssigned To => dmiguelez
2012-10-29 11:18caristuModules => Core
2012-10-29 11:18caristuOBNetwork customer => Yes
2012-10-29 11:18caristuSupport ticket => 17688
2012-10-29 11:18caristuResolution time => 1354230000
2012-10-29 11:18caristuIssue Monitored: networkb
2012-10-29 11:23dmiguelezAssigned Todmiguelez => jonalegriaesarte
2012-10-29 11:46jonalegriaesarteAssigned Tojonalegriaesarte => AugustoMauch
2012-11-08 11:15shankarbAssigned ToAugustoMauch => shankarb
2012-11-08 14:34shankarbFile Added: FixIssue22131.diff
2012-11-12 15:58shankarbReview Assigned To => dbaz
2012-11-12 15:58shankarbIssue Monitored: dbaz
2012-11-12 15:59shankarbStatusnew => scheduled
2012-11-12 15:59shankarbfix_in_branch => pi
2012-11-12 15:59shankarbStatusscheduled => resolved
2012-11-12 15:59shankarbFixed in Version => pi
2012-11-12 15:59shankarbFixed in SCM revision => https://code.openbravo.com/erp/devel/pi/rev/13c3d71a21b2 [^]
2012-11-12 15:59shankarbResolutionopen => fixed
2012-11-20 20:53dbazNote Added: 0054353
2012-11-20 20:53dbazStatusresolved => closed
2012-11-20 20:53dbazFixed in Versionpi => 3.0MP18

Notes
(0054353)
dbaz   
2012-11-20 20:53   
Reviewed @ changeset: 18577 - 776d5accc58d