Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033815Openbravo ERPA. Platformpublic2016-08-25 15:442016-08-25 17:15
caristu 
platform 
normalmajoralways
closedfixed 
5
 
3.0PR16Q3.13.0PR16Q3.1 
shuehner
Core
Production - QA Approved
2016-06-10
https://code.openbravo.com/erp/devel/pi/rev/ec3e4492a91c88e84d09e34b9e3e487f13ad3cb8 [^]
No
0033815: Initialization in OBCriteria should not be prevented under some circumstances
Initialization in OBCriteria should not be prevented under some circumstances, for example if we use list() with a new order by clause to an existing criteria after calling count(), i.e.:

  if (plVersionCrit.count() > 0) {
    plVersionCrit.addOrderBy(PriceListVersion.PROPERTY_VALIDFROMDATE, false);
    return plVersionCrit.list().get(0);
   }

The call to list does not initialize the query so it will skip the order by clause.
The PricelistVersionFilterExpression stops working as expected:

1 - Log in livebuilds 16Q3
2 - Go to Price List window and open "Tarifa de ventas"
3 - Create a new "Price list version", and use as base version "Tarifa de ventas"
4 - Go to "Product Price" tab
5 - Change the unit price of "Agua sin Gas 1L"
6 - Go to "Sales Order" and create a new sales order, select the price list "Tarifa de ventas"
7 - Create a new line
8 - Realize that when select the "Agua sin Gas 1L" product, the prices are the older prices.
No tags attached.
blocks defect 00338143.0PR16Q4 closed caristu Initialization in OBCriteria should not be prevented under some circumstances 
Issue History
2016-08-25 15:44caristuTypedefect => backport
2016-08-25 15:44caristuTarget Version => 3.0PR16Q3.1
2016-08-25 16:16hgbotCheckin
2016-08-25 16:16hgbotNote Added: 0089411
2016-08-25 16:16hgbotStatusscheduled => resolved
2016-08-25 16:16hgbotResolutionopen => fixed
2016-08-25 16:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q3.1/rev/35b4c1c83bab7951af8638b787dfadfe9729fd87 [^]
2016-08-25 16:17caristuReview Assigned To => shuehner
2016-08-25 16:17caristuIssue Monitored: shuehner
2016-08-25 17:15shuehnerNote Added: 0089413
2016-08-25 17:15shuehnerStatusresolved => closed
2016-08-25 17:15shuehnerFixed in Version => 3.0PR16Q3.1

Notes
(0089411)
hgbot   
2016-08-25 16:16   
Repository: erp/backports/3.0PR16Q3.1
Changeset: 35b4c1c83bab7951af8638b787dfadfe9729fd87
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Aug 25 16:15:48 2016 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR16Q3.1/rev/35b4c1c83bab7951af8638b787dfadfe9729fd87 [^]

fixes issue 33815: backed out initialization prevention changes

---
M src/org/openbravo/dal/service/OBCriteria.java
---
(0089413)
shuehner   
2016-08-25 17:15   
Verified that the backport was done correctly.
Q2 version of the OBCriteria file is identical to tip of Q3.1 branch after the backout (ignoring a formal change).

Also verified functionally that the added 'orderby' is no longer missing in the specified testcase (undoing changes in 33809,33811 for this test to trigger the regression).