Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0042915Openbravo ERPA. Platformpublic2020-01-16 16:512020-01-22 18:36
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
3.0PR20Q2 
caristu
Core
No
0042915: Tree selector cannot be used in a parameter window that is opened from the menu
When a parameter window contains a grid parameter that has a tree selector, it will only not work if the parameter window is opened directly from the menu. The window will not open and an error will be logged in the debugger.
- Install the attached module
- Login, use any non-system role
- Open the Test Tree PW window. The parameter window will not open and the following error will appear in the console:

Uncaught TypeError: Cannot read property 'filterEditorProperties' of null
    at _2.copyFunctionsFromGrid (90889d3cbdfeb1f33d577faa47a07219.js:31047)
    at _2.copyFunctionsFromViewGrid (90889d3cbdfeb1f33d577faa47a07219.js:31040)
    at _2.init (90889d3cbdfeb1f33d577faa47a07219.js:31021)
    at _2.isc_Class_completeCreation [as completeCreation] (ISC_Combined.js:287)
    at Object.isc_c_Class_create (ISC_Combined.js:182)
    at _2.initWidget (90889d3cbdfeb1f33d577faa47a07219.js:30994)
    at _2.isc_Canvas_init [as init] (ISC_Combined.js:1657)
    at _2.isc_Class_createAutoChild [as createAutoChild] (ISC_Combined.js:327)
    at _2.isc_Class_addAutoChild [as addAutoChild] (ISC_Combined.js:317)
    at _2.init (90889d3cbdfeb1f33d577faa47a07219.js:31321)
No tags attached.
blocks defect 0042916 closed AugustoMauch Selectors do not work properly in parameter windows if there are translations installed 
zip org.openbravo.testtreeinpw.zip (14,651) 2020-01-16 16:55
https://issues.openbravo.com/file_download.php?file_id=13854&type=bug
Issue History
2020-01-16 16:51AugustoMauchNew Issue
2020-01-16 16:51AugustoMauchAssigned To => AugustoMauch
2020-01-16 16:51AugustoMauchModules => Core
2020-01-16 16:51AugustoMauchTriggers an Emergency Pack => No
2020-01-16 16:55AugustoMauchFile Added: org.openbravo.testtreeinpw.zip
2020-01-16 16:56AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=20149#r20149
2020-01-16 17:04AugustoMauchRelationship addedblocks 0042916
2020-01-20 10:10hgbotCheckin
2020-01-20 10:10hgbotNote Added: 0117052
2020-01-20 10:10hgbotStatusnew => resolved
2020-01-20 10:10hgbotResolutionopen => fixed
2020-01-20 10:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/aab9548786465469c69435c88dd0b9f028d56ca1 [^]
2020-01-22 18:36caristuReview Assigned To => caristu
2020-01-22 18:36caristuNote Added: 0117179
2020-01-22 18:36caristuStatusresolved => closed
2020-01-22 18:36caristuFixed in Version => 3.0PR20Q2

Notes
(0117052)
hgbot   
2020-01-20 10:10   
Repository: erp/devel/pi
Changeset: aab9548786465469c69435c88dd0b9f028d56ca1
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Jan 16 17:24:21 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/aab9548786465469c69435c88dd0b9f028d56ca1 [^]

Fixes BUG-42915: Tree selectors can be used in menu parameter windows

The problem was that the code in OBTreeItemPopupFilterWindow.copyFunctionsFromGrid was assuming that the
grid where the selector has placed had a view that also had a viewGrid. This is not the case in grids that
are parameters in parameter windows that are open directly from the menu.

What the function does is to copy from functions from OBViewGrid to OBTreeItemPopupFilterWindow. For this
it does not need any real instance of viewGrid, any instance works. Because there is no real instance
available in this type of parameter windows, the issue has been fixed by creating a dummy one like this:

        if (grid == null) {
          grid = isc.OBViewGrid.create({ fields: [], view: {} });
        }

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree-filter.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0117179)
caristu   
2020-01-22 18:36   
Reviewed + tested OK: https://gitlab.com/openbravo/product/openbravo/merge_requests/34/ [^]