Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029385Openbravo ERPA. Platformpublic2015-03-24 10:012015-03-27 02:12
caristu 
alostale 
immediateminoralways
closedfixed 
5
3.0PR14Q2.6 
3.0PR15Q2 
AugustoMauch
Core
Production - Confirmed Stable
2014-01-07
3.0PR14Q2
http://code.openbravo.com/erp/devel/pi/rev/46ec5ec2839da79ae27a5225c105c85ecde1cf6a [^]
No
0029385: Distinct parameter is not working in JSON REST web services
Distinct parameter is not working in JSON REST web services. An error like the following is thrown when using it:

{"response":{"data":[{"response":{"status":-1,"error":{"message":"Exception when creating query select me from Product as me where ( exists (select 1 from Product inner join null.organization as i where i = me and e.organization.id in ('E443A31992CB4635AFCAEABE7183CE85', '0', 'DC206C91AA6A4897B44DA897936E0EC3', '7BABA5FF80494CAFA54DEBD22EC46F01', 'BAE22373FEBE4CCCA24517E23F0C8A48', '19404EAD144C49A0AF37D54377CF452D', 'B843C30461EA4501935CB1D125C9C25A', '2E60544D37534C0B89E765FE29BC0B43') and e.client.id in ('23C59575B9CF467C9620760EB255B389', '0')) )order by me.name","messageType":"Error","title":""},"totalRows":0}}
1) Do the following web service call

https://livebuilds.openbravo.com/erp_pi_pgsql/org.openbravo.service.json.jsonrest/Product?_distinct=organization [^]

Notice that the error is returned
No tags attached.
depends on backport 00294283.0PR15Q1.3 closed alostale Distinct parameter is not working in JSON REST web services 
caused by defect 00251823.0PR14Q2 closed alostale Query in org drop down in the list field is having bad performance 
Issue History
2015-03-24 10:01caristuNew Issue
2015-03-24 10:01caristuAssigned To => platform
2015-03-24 10:01caristuModules => Core
2015-03-24 10:01caristuRegression level => Production - Confirmed Stable
2015-03-24 10:01caristuTriggers an Emergency Pack => No
2015-03-24 10:01caristuIssue Monitored: networkb
2015-03-24 10:06caristuResolution time => 1433109600
2015-03-26 12:01alostaleStatusnew => scheduled
2015-03-26 12:01alostaleAssigned Toplatform => alostale
2015-03-26 14:54alostaleRelationship addedcaused by 0025182
2015-03-26 14:55alostaleReview Assigned To => AugustoMauch
2015-03-26 14:55alostaleRegression date => 2014-01-07
2015-03-26 14:55alostaleRegression introduced in release => 3.0PR14Q2
2015-03-26 14:55alostaleRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/46ec5ec2839da79ae27a5225c105c85ecde1cf6a [^]
2015-03-26 15:22hgbotCheckin
2015-03-26 15:22hgbotNote Added: 0076012
2015-03-26 15:22hgbotCheckin
2015-03-26 15:22hgbotNote Added: 0076013
2015-03-26 15:22hgbotStatusscheduled => resolved
2015-03-26 15:22hgbotResolutionopen => fixed
2015-03-26 15:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/088b4114ac745dad78496622bd588c1a8a1423b9 [^]
2015-03-26 18:13AugustoMauchNote Added: 0076031
2015-03-26 18:13AugustoMauchStatusresolved => closed
2015-03-26 18:13AugustoMauchFixed in Version => 3.0PR15Q2
2015-03-27 02:12hudsonbotCheckin
2015-03-27 02:12hudsonbotNote Added: 0076042
2015-03-27 02:12hudsonbotCheckin
2015-03-27 02:12hudsonbotNote Added: 0076043

Notes
(0076012)
hgbot   
2015-03-26 15:22   
Repository: erp/devel/pi
Changeset: 3c52c4d0b73b20527effadf0ce4676bd7f638891
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Mar 26 15:15:16 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3c52c4d0b73b20527effadf0ce4676bd7f638891 [^]

related to bug 29385: Distinct parameter is not working in JSON REST web services

  Added test cases

---
M src-test/src/org/openbravo/test/webservice/JSONWebServices.java
---
(0076013)
hgbot   
2015-03-26 15:22   
Repository: erp/devel/pi
Changeset: 088b4114ac745dad78496622bd588c1a8a1423b9
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Mar 26 15:21:18 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/088b4114ac745dad78496622bd588c1a8a1423b9 [^]

fixed bug 29385: Distinct parameter is not working in JSON REST web services

  Using _distinct property in JSON REST webservices resulted in an incorrectly
  generated query. There were 2 problems:

   - Entity name for was set in the fetch method, after the refactor done to fix
     issue 0025182, entity is different in case of using _distinct, and it is managed
     by QueryService.
   - This refactor also requires of using aliases to work

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonRestServlet.java
---
(0076031)
AugustoMauch   
2015-03-26 18:13   
Code reviewed and verified in pi@9a240957107d
(0076042)
hudsonbot   
2015-03-27 02:12   
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/b8858c8b542b [^]
Maturity status: Test
(0076043)
hudsonbot   
2015-03-27 02:12   
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/b8858c8b542b [^]
Maturity status: Test