Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0033814 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | always | 2016-08-25 15:44 | 2016-09-06 11:44 | |||
Reporter | caristu | View Status | public | |||||
Assigned To | caristu | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | pi | |||
Status | closed | Fix in branch | Fixed in SCM revision | e309320cd579 | ||||
Projection | none | ETA | none | Target Version | 3.0PR16Q4 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Review Assigned To | shuehner | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | Production - QA Approved | |||||||
Regression date | 2016-06-10 | |||||||
Regression introduced in release | ||||||||
Regression introduced by commit | https://code.openbravo.com/erp/devel/pi/rev/ec3e4492a91c88e84d09e34b9e3e487f13ad3cb8 [^] | |||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0033814: Initialization in OBCriteria should not be prevented under some circumstances | |||||||
Description | 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. | |||||||
Steps To Reproduce | 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. | |||||||
Tags | No tags attached. | |||||||
Attached Files | queries.txt [^] (3,209 bytes) 2016-08-25 15:58 [Show Content] | |||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |||||||||||||||||||||||||||||
|
Notes | |
(0089408) caristu (developer) 2016-08-25 15:59 |
Attached queries executed by the PricelistVersionFilterExpression for the count() and list() operations. Note that the order by clause is missing. |
(0089409) shuehner (administrator) 2016-08-25 16:00 |
Bug is that the change did prevent calling 'initialize()' multiple times on the same instance to prevent double-adding some filters to the generated query (i.e. client or org filters). However the skipped method is also in charge of 'adding orderBy' So given following calling code (as used in 33797 before fixing 0033705) if (plVersionCrit.count() > 0) { plVersionCrit.addOrderBy(PriceListVersion.PROPERTY_VALIDFROMDATE, false); return plVersionCrit.list().get(0); } The SQL generated for the list call is completely missing the order by. So the change must be revisited to only skip part which are known to be needed really just once, and cannot change. Note: even client+org filter may change if after a first i.e. count call setFilterOnReadable ... methods or similar are called. So maybe a different fix could be to not skip 'initialize()' call at all. But instead make it 'start from 0' fresh to add all current filters to a completely clean hql. |
(0089410) hgbot (developer) 2016-08-25 16:07 |
Repository: erp/devel/pi Changeset: e309320cd579c59080b4bb04a060b2862840ab2e Author: Carlos Aristu <carlos.aristu <at> openbravo.com> Date: Thu Aug 25 16:06:43 2016 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/e309320cd579c59080b4bb04a060b2862840ab2e [^] fixes issue 33814: backed out initialization prevention changes --- M src/org/openbravo/dal/service/OBCriteria.java --- |
(0089412) shuehner (administrator) 2016-08-25 16:48 |
Verified that change if correctly backing out initial change. For testing, undo of 33705 And tested that for the use-case described in this issue the order is no longer missing for the 2nd .list() query. |
(0089419) hudsonbot (developer) 2016-08-25 22:53 |
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/5e50832c9b35 [^] Maturity status: Test |
Issue History | |||
Date Modified | Username | Field | Change |
2016-08-25 15:44 | caristu | New Issue | |
2016-08-25 15:44 | caristu | Assigned To | => platform |
2016-08-25 15:44 | caristu | Modules | => Core |
2016-08-25 15:44 | caristu | Regression level | => Production - QA Approved |
2016-08-25 15:44 | caristu | Regression date | => 2016-06-10 |
2016-08-25 15:44 | caristu | Regression introduced by commit | => https://code.openbravo.com/erp/devel/pi/rev/ec3e4492a91c88e84d09e34b9e3e487f13ad3cb8 [^] |
2016-08-25 15:44 | caristu | Triggers an Emergency Pack | => No |
2016-08-25 15:44 | caristu | Status | new => acknowledged |
2016-08-25 15:44 | caristu | Status | acknowledged => scheduled |
2016-08-25 15:44 | caristu | Target Version | => 3.0PR16Q4 |
2016-08-25 15:45 | caristu | Relationship added | related to 0033797 |
2016-08-25 15:56 | shuehner | Relationship added | caused by 0033138 |
2016-08-25 15:58 | caristu | File Added: queries.txt | |
2016-08-25 15:59 | caristu | Note Added: 0089408 | |
2016-08-25 16:00 | shuehner | Note Added: 0089409 | |
2016-08-25 16:07 | hgbot | Checkin | |
2016-08-25 16:07 | hgbot | Note Added: 0089410 | |
2016-08-25 16:07 | hgbot | Status | scheduled => resolved |
2016-08-25 16:07 | hgbot | Resolution | open => fixed |
2016-08-25 16:07 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/e309320cd579c59080b4bb04a060b2862840ab2e [^] |
2016-08-25 16:16 | caristu | Review Assigned To | => shuehner |
2016-08-25 16:16 | caristu | Issue Monitored: shuehner | |
2016-08-25 16:18 | caristu | Relationship added | related to 0033816 |
2016-08-25 16:48 | shuehner | Note Added: 0089412 | |
2016-08-25 16:48 | shuehner | Status | resolved => closed |
2016-08-25 16:48 | shuehner | Fixed in Version | => pi |
2016-08-25 22:53 | hudsonbot | Checkin | |
2016-08-25 22:53 | hudsonbot | Note Added: 0089419 | |
2016-09-06 11:44 | caristu | Assigned To | platform => caristu |
Copyright © 2000 - 2009 MantisBT Group |