Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030933Openbravo ERPA. Platformpublic2015-09-25 12:232015-11-23 21:16
egoitz 
NaroaIriarte 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q1 
alostale
Core
No
0030933: Error when using on a new selector a column whose reference is a tree
When the grid of the selector contains a column that has been defined with "reference" tree reference and "reference search key" =Producto Category Tree selector,
when opening the grid selector the window is locked.
-Define a reference which type is "Tree Reference" and "m_product_category" table as tree reference. Call it "Product Category Tree Selector".
-Change the definition of the m_product_category_id column on the m_product by changing the reference to "Tree reference" and the reference search key to "Product Category Tree Selector".
-Recompile the application.

-Go to List price window.
-go to the product price subtab and open the selector popup.
*The window is locked and a js error raised:


Uncaught TypeError: Cannot read property 'treeGridFields' of undefinedisc.OBTreeFilterItem.addProperties.init @ 995cb4a3cf5944d391a1ecfc27b8e07d.js:1307isc_Class_completeCreation @ ISC_Combined.js:287isc_DynamicForm_createItem @ ISC_Combined.js:7961isc_DynamicForm__addItems @ ISC_Combined.js:7945isc_DynamicForm_setItems @ ISC_Combined.js:7939isc_GridBody_draw @ ISC_Combined.js:5176isc_Layout_layoutChildren @ ISC_Combined.js:3661isc_ListGrid_layoutChildren @ ISC_Combined.js:5562isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_c_Class_Super @ ISC_Combined.js:237isc_RecordEditor_layoutChildren @ ISC_Combined.js:7233isc_Layout_drawChildren @ ISC_Combined.js:3580isc_Canvas_draw @ ISC_Combined.js:1690isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_ListGrid_draw @ ISC_Combined.js:5623isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_c_Class_Super @ ISC_Combined.js:237isc_RecordEditor_draw @ ISC_Combined.js:7207isc_Layout_layoutChildren @ ISC_Combined.js:3661isc_ListGrid_layoutChildren @ ISC_Combined.js:5562isc_Layout_drawChildren @ ISC_Combined.js:3580isc_Canvas_draw @ ISC_Combined.js:1690isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_ListGrid_draw @ ISC_Combined.js:5623isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_c_Class_Super @ ISC_Combined.js:237isc.OBGrid.addProperties.draw @ 995cb4a3cf5944d391a1ecfc27b8e07d.js:1114isc_Layout_layoutChildren @ ISC_Combined.js:3661isc_Layout_drawChildren @ ISC_Combined.js:3580isc_Canvas_draw @ ISC_Combined.js:1690isc_Layout_layoutChildren @ ISC_Combined.js:3661isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_Window_layoutChildren @ ISC_Combined.js:4208isc_Layout_drawChildren @ ISC_Combined.js:3580isc_Canvas_draw @ ISC_Combined.js:1690isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_Window_draw @ ISC_Combined.js:4185isc_Canvas_show @ ISC_Combined.js:2293isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_Window_show @ ISC_Combined.js:4215isc_c_Class_invokeSuper @ ISC_Combined.js:245isc_c_Class_Super @ ISC_Combined.js:237isc.OBSelectorPopupWindow.addProperties.show @ 995cb4a3cf5944d391a1ecfc27b8e07d.js:3049isc.OBSelectorPopupWindow.addProperties.fetchDefaultsCallback @ 995cb4a3cf5944d391a1ecfc27b8e07d.js:3054callback @ 995cb4a3cf5944d391a1ecfc27b8e07d.js:3053isc_c_Class_fireCallback @ ISC_Combined.js:254isc_Class_fireCallback @ ISC_Combined.js:314isc_c_RPCManager_fireReplyCallback @ ISC_Combined.js:11698isc_c_RPCManager_fireReplyCallbacks @ ISC_Combined.js:11703isc_c_RPCManager_performOperationReply @ ISC_Combined.js:11696isc_c_RPCManager__performTransactionReply @ ISC_Combined.js:11681isc_c_RPCManager_performTransactionReply @ ISC_Combined.js:11613(anonymous function) @ VM1361:3isc_c_Class_fireCallback @ ISC_Combined.js:254isc_c_Comm_performXmlTransactionReply @ ISC_Combined.js:1055(anonymous function) @ VM1360:3isc_c_Class_fireCallback @ ISC_Combined.js:254isc_c_Comm__fireXMLCallback @ ISC_Combined.js:1038_12 @ ISC_Combined.js:1043
No tags attached.
related to defect 0030812 closed NaroaIriarte Multiple filtering not allowed using tree reference selector in a pick and execute window grid. 
related to defect 0031213 acknowledged Triage Platform Base js error opening selector popup having a tree column in selector's grid 
Issue History
2015-09-25 12:23egoitzNew Issue
2015-09-25 12:23egoitzAssigned To => platform
2015-09-25 12:23egoitzModules => Core
2015-09-25 12:23egoitzResolution time => 1444428000
2015-09-25 12:23egoitzTriggers an Emergency Pack => No
2015-09-28 08:47alostaleRelationship addedrelated to 0030812
2015-09-28 08:47alostaleStatusnew => scheduled
2015-09-28 08:47alostaleAssigned Toplatform => NaroaIriarte
2015-09-29 11:06NaroaIriarteSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9501#r9501
2015-10-02 13:48gorozcohIssue Monitored: gorozcoh
2015-10-09 13:22NaroaIriarteReview Assigned To => alostale
2015-10-16 12:48NaroaIriarteNote Added: 0081057
2015-10-17 22:04hgbotCheckin
2015-10-17 22:04hgbotNote Added: 0081064
2015-10-17 22:04hgbotStatusscheduled => resolved
2015-10-17 22:04hgbotResolutionopen => fixed
2015-10-17 22:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9875d4d271a640c685d1d85b2afa172a31777559 [^]
2015-10-22 10:03alostaleRelationship addedrelated to 0031213
2015-10-22 10:04alostaleNote Added: 0081190
2015-10-22 10:04alostaleStatusresolved => closed
2015-10-22 10:04alostaleFixed in Version => 3.0PR16Q1
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082130

Notes
(0081057)
NaroaIriarte   
2015-10-16 12:48   
This fix only works when the selector field has a column.
If it does not have a column it will not work, so I will report a related issue to this one explaining this scenario and it will be fixed separately.
(0081064)
hgbot   
2015-10-17 22:04   
Repository: erp/devel/pi
Changeset: 9875d4d271a640c685d1d85b2afa172a31777559
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Fri Oct 16 12:34:52 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9875d4d271a640c685d1d85b2afa172a31777559 [^]

Fixed issue 30933: Selectors with tree reference were not working fine.

Some classes have been changed; first of all, in the ob-formitem-tree-filter.js the problem was that there was no logic
for the selector windows and this logic has been added.

There was other problem, in SelectorComponent.java. This class is the one which handles the ftl of the selectors and
there was no logic for the tree references. The getFilterEditorProperties() has been modified for being able to show
the needed structure in the view. The Datasource Id, the treeGridFields and the treeReference were needed.
A new method called getTreeGridFieldsDefinition() has been created to get the correct structure with the correct data in the
tree grid fields.

Now it is possible to use a new selector with a column whose reference is a tree.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree-filter.js
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/FKTreeUIDefinition.java
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorComponent.java
---
(0081190)
alostale   
2015-10-22 10:04   
Code reviewed
Tested: it works fine but there is still a js error in console, reported as a different issue 0031213
(0082130)
hudsonbot   
2015-11-23 21:16   
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/7b56bebaaa88 [^]
Maturity status: Test