Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024637Openbravo ERPA. Platformpublic2013-08-30 14:282013-09-27 14:15
caristu 
shankarb 
highminorhave not tried
closedfixed 
5
 
3.0MP283.0MP28 
AugustoMauch
Core
No
0024637: Display Logic does not work in tabs located in windows that have several tabs referencing the same entity
Display logic is not working in those windows where the referenced table in the header is also referenced in another tab in the same window.
As system administrator:

1) Go to [Windows, tabs and fields] and look for the Business Partner window (In this window, the c_bpartner table is referenced in the header and also in other tabs: Customer, Vendor and Employee)

2) Add a display logic for the Location/Address tab, for example: @Name2@='AA'

Log-out and Log-in as group admin role

3) Go to the BusinessPartner window and notice that the display logic doesn't work
In the KernelUtils.java class the entities referenced in tabs are stored inside the tabOfEntity hashMap, which stores the entity-tab relationship.

When we have more than one entity referenced in the same window, the header reference is overwritten in the hash-map with the tab referencing the same entity. (Line 406: tabOfEntity.put(entity, aTab);)

Attached is a patch that solves this problem, avoiding this override. But it must be checked if it is valid in all possible scenarios.
No tags attached.
has duplicate defect 00247633.0MP29 closed AugustoMauch Display logic for tabs not working properly for tabs that reference the same entity of the header 
related to defect 00246383.0MP28 closed shankarb An error appears when using a field in the tab display logic which is present in the header and also in the tab 
diff tabIssue.diff (713) 2013-08-30 14:28
https://issues.openbravo.com/file_download.php?file_id=6361&type=bug
Issue History
2013-08-30 14:28caristuNew Issue
2013-08-30 14:28caristuAssigned To => AugustoMauch
2013-08-30 14:28caristuFile Added: tabIssue.diff
2013-08-30 14:28caristuModules => Core
2013-08-30 14:28caristuResolution time => 1384383600
2013-08-30 14:28caristuTriggers an Emergency Pack => No
2013-08-30 14:28caristuIssue Monitored: networkb
2013-08-30 14:29caristuProposed Solution updated
2013-08-30 14:31caristuTarget Version => 3.0MP28
2013-08-30 14:41caristuRelationship addedrelated to 0024638
2013-08-30 14:42caristuPrioritynormal => high
2013-09-01 07:37shankarbAssigned ToAugustoMauch => shankarb
2013-09-03 07:07shankarbStatusnew => scheduled
2013-09-03 07:07shankarbNote Added: 0060880
2013-09-03 07:07shankarbfix_in_branch => pi
2013-09-05 06:32shankarbReview Assigned To => AugustoMauch
2013-09-05 06:32shankarbfix_in_branchpi =>
2013-09-05 06:32shankarbIssue Monitored: AugustoMauch
2013-09-05 06:34hgbotCheckin
2013-09-05 06:34hgbotNote Added: 0060924
2013-09-05 06:34hgbotStatusscheduled => resolved
2013-09-05 06:34hgbotResolutionopen => fixed
2013-09-05 06:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d208b0b6ef089881027acb04b58392058a9bfe98 [^]
2013-09-13 10:14caristuRelationship addedrelated to 0024763
2013-09-13 10:28AugustoMauchNote Added: 0061132
2013-09-13 10:28AugustoMauchStatusresolved => new
2013-09-13 10:28AugustoMauchResolutionfixed => open
2013-09-17 19:02hudsonbotCheckin
2013-09-17 19:02hudsonbotNote Added: 0061218
2013-09-19 11:27shankarbStatusnew => scheduled
2013-09-19 11:27shankarbfix_in_branch => pi
2013-09-19 11:28shankarbNote Added: 0061292
2013-09-19 11:28shankarbStatusscheduled => resolved
2013-09-19 11:28shankarbFixed in Version => pi
2013-09-19 11:28shankarbFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/d208b0b6ef089881027acb04b58392058a9bfe98 [^] => http://code.openbravo.com/erp/devel/pi/rev/06606d1fa59dc0e973c2033683e7e041672227f7 [^]
2013-09-19 11:28shankarbResolutionopen => fixed
2013-09-27 14:14AugustoMauchNote Added: 0061447
2013-09-27 14:14AugustoMauchStatusresolved => closed
2013-09-27 14:15AugustoMauchFixed in Versionpi => 3.0MP28
2013-09-30 14:55AugustoMauchRelationship replacedhas duplicate 0024763

Notes
(0060880)
shankarb   
2013-09-03 07:07   
Issue fixed. Will be pushed in MP28.
(0060924)
hgbot   
2013-09-05 06:34   
Repository: erp/devel/pi
Changeset: d208b0b6ef089881027acb04b58392058a9bfe98
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Mon Sep 02 09:48:15 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d208b0b6ef089881027acb04b58392058a9bfe98 [^]

Fixes Issue 0024637: Display Logic does not work in tabs located in windows that have several tabs referencing the same entity

When we have more than one entity referenced in the same window, the header reference is overwritten in the hash-map with the tab referencing the same entity.
Overriding is prevented and only if entity is not found in the hash map, it is added.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
---
(0061132)
AugustoMauch   
2013-09-13 10:28   
The code that was modified belongs to the getParentTab method of the KernelUtils class. Given a tab, this method returns its parent tab. Suppose this tab structure:

[Tab1 | Entity1]
|
| - [Tab2 | Entity1]
| |
| | - [Tab3 | Entity2]
|
| - [Tab4 | Entity1]
| |
| | - [Tab5 | Entity3]
|
| - [Tab6 | Entity4]

In this case, KernelUtils.getParentTab(tab3) would return tab1, because that is the class associated with the entity1, which is the referenced entity by the tab3 link to parent column.

This issue can be closed when the getParentTab returns the following:
getParentTab(tab1) => null
getParentTab(tab2) => tab1
getParentTab(tab3) => tab2
getParentTab(tab4) => tab1
getParentTab(tab5) => tab4
getParentTab(tab6) => tab1

One way to achieve this would be to store in the tabOfEntity hash an array of tabs for each entity, and then adding some logic to, given an entity, selecting the proper parent tab, probably taking into account the tab level and the tab sequence number.
(0061218)
hudsonbot   
2013-09-17 19:02   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/1c53d622fc50 [^]

Maturity status: Test
(0061292)
shankarb   
2013-09-19 11:28   
Issue fixed in the changeset http://code.openbravo.com/erp/devel/pi/rev/06606d1fa59dc0e973c2033683e7e041672227f7 [^] . The other issue 24638 has been reopened becuase the fix does not solve the issue completely.
(0061447)
AugustoMauch   
2013-09-27 14:14   
Code reviewed and verified in pi@34a6241c3e04