Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036728Openbravo ERPA. Platformpublic2017-08-28 14:552017-09-21 16:49
JONHM 
caristu 
highmajoralways
closedfixed 
5
 
3.0PR17Q4 
alostale
Core
Production - Confirmed Stable
2017-06-21
3.0PR17Q1
https://code.openbravo.com/erp/devel/pi/rev/bdca94625dbf67b7e9dbf54f7535f6f22b499b14 [^]
No
0036728: Error displaying in selector picklist a field based in a non-primitive derived property
An error is thrown when using a selector that is configured to display a field in the picklist which is based in a non-primitive derived property, i.e., a property resolved through property navigation which points to a reference.
- As System Administrator
1) Open window "Reference" and select 'Product (by Price and Warehouse)'
2) Switch to [Defined Selector] tab and then to [Defined Selector Field] subtab
3) Create a new record:
  Name: Product2
  Property: productPrice.product
  Show in picklist: YES

- As F&B International Group Admin
4) Open "Sales Order" window and create a new record from 'Alimentos y Supermercados, S.A' bussiness partner
5) Create a new line and open the 'Product' selector picklist

--> It shows the following error in the log:
ERROR org.openbravo.service.json.DefaultJsonDataService - java.lang.NullPointerException
    at org.openbravo.service.json.DataToJsonConverter.toJsonObject(DataToJsonConverter.java:219)
    at org.openbravo.service.json.DataToJsonConverter.toJsonObjects(DataToJsonConverter.java:144)
    at org.openbravo.service.json.DefaultJsonDataService.fetch(DefaultJsonDataService.java:301)
    at org.openbravo.service.datasource.DefaultDataSourceService.fetch(DefaultDataSourceService.java:85)
    at org.openbravo.service.datasource.DefaultDataSourceService.fetch(DefaultDataSourceService.java:78)
    at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:285)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:843)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
        ...

No tags attached.
depends on backport 00367373.0PR17Q3 closed caristu Error displaying in selector picklist a field based in a non-primitive derived property 
depends on backport 00367393.0PR17Q2.3 closed caristu Error displaying in selector picklist a field based in a non-primitive derived property 
depends on backport 00367403.0PR17Q1.4 closed caristu Error displaying in selector picklist a field based in a non-primitive derived property 
caused by defect 0036268 closed caristu Product Complete selector does not show some fields on picklist 
related to defect 0036929 closed caristu SelectorPickListFieldsDataSourceTest test is not being executed in CI 
Issue History
2017-08-28 14:55JONHMNew Issue
2017-08-28 14:55JONHMAssigned To => platform
2017-08-28 14:55JONHMModules => Core
2017-08-28 14:55JONHMResolution time => 1505685600
2017-08-28 14:55JONHMTriggers an Emergency Pack => No
2017-08-28 14:59JONHMSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15731#r15731
2017-08-29 08:14JONHMSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15732#r15732
2017-08-29 12:35caristuSummaryError displaying picklist when some of its 'defined selector field' has a OBUISEL_Selector reference => Error displaying in selector picklist a field based a non-primitive derived property
2017-08-29 12:35caristuDescription Updatedbug_revision_view_page.php?rev_id=15737#r15737
2017-08-29 12:35caristuRelationship addedcaused by 0036268
2017-08-29 12:37caristuRegression date => 2017-06-21
2017-08-29 12:37caristuRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/bdca94625dbf67b7e9dbf54f7535f6f22b499b14 [^]
2017-08-29 12:37caristuAssigned Toplatform => caristu
2017-08-29 12:38caristuStatusnew => scheduled
2017-08-29 12:38caristuRegression level => Packaging and release
2017-08-29 13:03hgbotCheckin
2017-08-29 13:03hgbotNote Added: 0098698
2017-08-29 13:03hgbotStatusscheduled => resolved
2017-08-29 13:03hgbotResolutionopen => fixed
2017-08-29 13:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2174cbb90a5a77d9ee8d3d0140a14bbda8093223 [^]
2017-08-29 13:12caristuStatusresolved => new
2017-08-29 13:12caristuResolutionfixed => open
2017-08-29 13:12caristuStatusnew => scheduled
2017-08-29 13:12caristuStatusscheduled => resolved
2017-08-29 13:12caristuResolutionopen => fixed
2017-08-29 13:32caristuSummaryError displaying in selector picklist a field based a non-primitive derived property => Error displaying in selector picklist a field based in a non-primitive derived property
2017-08-29 13:37caristuReview Assigned To => alostale
2017-08-29 13:51caristuRegression levelPackaging and release => Production - Confirmed Stable
2017-08-29 14:33caristuNote Added: 0098703
2017-08-29 14:36caristuDescription Updatedbug_revision_view_page.php?rev_id=15738#r15738
2017-08-29 14:36caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15739#r15739
2017-08-30 10:26alostaleNote Added: 0098724
2017-08-30 10:26alostaleStatusresolved => closed
2017-08-30 10:26alostaleFixed in Version => 3.0PR17Q4
2017-08-30 13:58hgbotCheckin
2017-08-30 13:58hgbotNote Added: 0098732
2017-08-30 14:10hgbotCheckin
2017-08-30 14:10hgbotNote Added: 0098734
2017-08-30 18:49dmitry_mezentsevRegression introduced in release => 3.0PR17Q1
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099339
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099347
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099348
2017-09-22 14:32caristuRelationship addedrelated to 0036929

Notes
(0098698)
hgbot   
2017-08-29 13:03   
Repository: erp/devel/pi
Changeset: 2174cbb90a5a77d9ee8d3d0140a14bbda8093223
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Aug 29 13:02:40 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2174cbb90a5a77d9ee8d3d0140a14bbda8093223 [^]

fixes bug 36728: Can't use fields based on some properties in selector picklist

With the fix for issue 0036268 the selector fields based on derived properties that are shown in the picklist are sent as 'extra properties' in order to calculate them properly.

The problem is that the fix was not complete when the derived properties were not primitive. In that case the DataToJsonConverter class was not calculating properly the referenced property.

Now that kind of properties are calculated properly.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
---
(0098703)
caristu   
2017-08-29 14:33   
Added a new test into TestLink[1], to test that derived properties which are not primitive can be displayed on a selector drop-down list.

[1] https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-10730 [^]
(0098724)
alostale   
2017-08-30 10:26   
code reviewed

tested as described in steps and also related issue
(0098732)
hgbot   
2017-08-30 13:58   
Repository: erp/devel/pi
Changeset: d1b171923e5e080b2da6bb20c74db06d6c8a3b76
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Aug 30 13:57:11 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d1b171923e5e080b2da6bb20c74db06d6c8a3b76 [^]

related to issue 36728: added test case

---
A src-test/src/org/openbravo/test/datasource/SelectorPickListFieldsDataSourceTest.java
---
(0098734)
hgbot   
2017-08-30 14:10   
Repository: erp/devel/pi
Changeset: b9227826b5dc80b718b8ef83f49fe1d1dd4d432d
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Aug 30 14:10:12 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b9227826b5dc80b718b8ef83f49fe1d1dd4d432d [^]

related to issue 36728: improved test to check that properties are not empty

---
M src-test/src/org/openbravo/test/datasource/SelectorPickListFieldsDataSourceTest.java
---
(0099339)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test
(0099347)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test
(0099348)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test