Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030403Openbravo ERPA. Platformpublic2015-07-22 10:022015-08-20 23:16
caristu 
caristu 
immediateminoralways
closedfixed 
5
 
3.0PR15Q4 
alostale
Core
Pre packaging ( pi )
2015-07-06
pi
http://code.openbravo.com/erp/devel/pi/rev/22f85795e81fcad7a6c4c5465ba60d582c69919b [^]
No
0030403: Unexpected behavior in grid view with OBUISEL_Selector reference when the Display Field is set
Is not possible to save a record in grid view if it includes a column with an OBUISEL_Selector reference which is not of custom query type and it has the Display Field set
As system administrator
1) Go to the [Reference] window, select the "Business Partner selector" reference and navigate to the Defined Selector tab. Set a value for the Display Field, for example Search Key.
2) Go to [Tables and Columns] and change the reference used for the C_BPartner_ID column in the C_Order table, using the "Business partner selector" instead.
As group admin
3) Go to the Sales Order window, try to save a record in grid view.
No tags attached.
related to defect 00274693.0PR14Q4 closed shankarb Unexpected behavior in OBUISEL_Selector reference when the Display Field is set 
related to defect 00238903.0MP24 closed AugustoMauch Bad behaviour on grid view when searching on a selector field if the selector has defined a diplayed field 
depends on backport 00304043.0PR15Q3 closed caristu Unexpected behavior in grid view with OBUISEL_Selector reference when the Display Field is set 
depends on backport 00304053.0PR15Q2.3 closed caristu Unexpected behavior in grid view with OBUISEL_Selector reference when the Display Field is set 
caused by defect 0030297 closed alostale Reference with Search parent reference (old selector) is not working under some circumstances 
png selectorDisplayFieldSave.png (63,644) 2015-07-22 10:02
https://issues.openbravo.com/file_download.php?file_id=8297&type=bug
png

txt selectorDefinition.txt (8,005) 2015-07-22 13:35
https://issues.openbravo.com/file_download.php?file_id=8299&type=bug
diff issue30403.diff (2,837) 2015-07-22 17:49
https://issues.openbravo.com/file_download.php?file_id=8301&type=bug
Issue History
2015-07-22 10:02caristuNew Issue
2015-07-22 10:02caristuAssigned To => platform
2015-07-22 10:02caristuFile Added: selectorDisplayFieldSave.png
2015-07-22 10:02caristuModules => Core
2015-07-22 10:02caristuRegression level => Pre packaging ( pi )
2015-07-22 10:02caristuRegression date => 2015-07-06
2015-07-22 10:02caristuRegression introduced in release => pi
2015-07-22 10:02caristuRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/22f85795e81fcad7a6c4c5465ba60d582c69919b [^]
2015-07-22 10:02caristuTriggers an Emergency Pack => No
2015-07-22 10:03caristuAssigned Toplatform => caristu
2015-07-22 10:10alostaleRelationship addedcaused by 0030297
2015-07-22 10:10alostaleRelationship addedrelated to 0027469
2015-07-22 10:10alostaleReview Assigned To => alostale
2015-07-22 10:11alostaleStatusnew => scheduled
2015-07-22 13:31caristuNote Added: 0079028
2015-07-22 13:35caristuFile Added: selectorDefinition.txt
2015-07-22 13:37caristuNote Edited: 0079028bug_revision_view_page.php?bugnote_id=0079028#r9075
2015-07-22 13:37caristuFile Added: issue30403.diff
2015-07-22 16:53caristuNote Edited: 0079028bug_revision_view_page.php?bugnote_id=0079028#r9076
2015-07-22 17:49caristuFile Deleted: issue30403.diff
2015-07-22 17:49caristuFile Added: issue30403.diff
2015-07-22 17:50caristuNote Edited: 0079028bug_revision_view_page.php?bugnote_id=0079028#r9079
2015-07-22 20:08caristuIssue Monitored: alostale
2015-07-22 20:09hgbotCheckin
2015-07-22 20:09hgbotNote Added: 0079035
2015-07-22 20:09hgbotStatusscheduled => resolved
2015-07-22 20:09hgbotResolutionopen => fixed
2015-07-22 20:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cd1ddf017185991943a616cae587cd15f35d3a5a [^]
2015-07-23 10:55alostaleNote Added: 0079038
2015-07-23 10:55alostaleStatusresolved => closed
2015-07-23 10:55alostaleFixed in Version => 3.0PR15Q4
2015-07-23 11:20alostaleRelationship addedrelated to 0023890
2015-07-23 11:21alostaleNote Edited: 0079038bug_revision_view_page.php?bugnote_id=0079038#r9081
2015-07-23 11:22alostaleNote Added: 0079039
2015-07-23 11:22alostaleStatusclosed => new
2015-07-23 11:22alostaleResolutionfixed => open
2015-07-23 11:22alostaleFixed in Version3.0PR15Q4 =>
2015-07-23 11:49hgbotCheckin
2015-07-23 11:49hgbotNote Added: 0079040
2015-07-23 17:30alostaleStatusnew => scheduled
2015-07-23 17:30alostaleStatusscheduled => resolved
2015-07-23 17:30alostaleFixed in Version => 3.0PR15Q4
2015-07-23 17:30alostaleResolutionopen => fixed
2015-07-23 17:30alostaleStatusresolved => closed
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079503
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079504

Notes
(0079028)
caristu   
2015-07-22 13:31   
(edited on: 2015-07-22 17:50)
The problem is that the _extraProperties in the datasource used by the selector does not contain the entity name if they are referencing to the main entity. When trying to set the selected value of the selector picklist in grid view, the display field name was never found as we currently return 'entity$property' as the display field name, instead of looking directly for 'property' when we are using a property that references the main entity on the display field (See attached selectorDefinition.txt).

The solution in issue 0027469 was not the most suitable so the change to fix it in issue 0030297 was correct. Just the attached fix was missing.

This fix has been pushed to try. It has been tested with the following selectors:

- Product (Search reference with FKSelectorUIDefinition UI definition)

- Business Partner selector

- Business Partner (Search reference with FKSelectorUIDefinition UI definition) (is Custom Query, so not affected)

(0079035)
hgbot   
2015-07-22 20:09   
Repository: erp/devel/pi
Changeset: cd1ddf017185991943a616cae587cd15f35d3a5a
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jul 22 17:02:50 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/cd1ddf017185991943a616cae587cd15f35d3a5a [^]

Fixes issue 30403: selectors not working in grid view when display field is set

When setting the display field for a selector with FKSelectorUIDefinition as its UI Definition class, if the display field was referencing to a property of the main entity of the selector, the display field name returned as part of the gridProps in the view definition was 'entity'.
The _extraProperties in the datasource used by the selector does not contain the entity name if they are referencing to the main entity. That is the root of the problem: when trying to set the selected value of the selector picklist in grid view, the display field name was never found as we were using 'entity' instead of looking directly for 'property'.
This problem does not affect when setting as display field a field that references a property which does not belong to the main entity of the selector.
To solve this problem, now in FKSelectorUIDefinition we return 'property' as the display field name instead of 'entity' when the property belongs to the main entity.

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/reference/FKSelectorUIDefinition.java
---
(0079038)
alostale   
2015-07-23 10:55   
(edited on: 2015-07-23 11:21)
code reviewed

* tested with Search and OBUISEL_Selector references both in grid and form views * tested issue 0030297
* tested issue 0023890

(0079039)
alostale   
2015-07-23 11:22   
reopening due to code review:
  private method FKSelectorUIDefinition.getFirstProperty is no longer used after this fix, it should be removed
(0079040)
hgbot   
2015-07-23 11:49   
Repository: erp/devel/pi
Changeset: a6b70470ce55d90a19952f163ee69d937cffca2c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Jul 23 11:47:59 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a6b70470ce55d90a19952f163ee69d937cffca2c [^]

Related to issue 30403: Removed unused getFirstProperty method

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/reference/FKSelectorUIDefinition.java
---
(0079503)
hudsonbot   
2015-08-20 23: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/8c91718397a5 [^]
Maturity status: Test
(0079504)
hudsonbot   
2015-08-20 23: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/8c91718397a5 [^]
Maturity status: Test