Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027829Openbravo ERPA. Platformpublic2014-10-10 12:002014-12-30 23:26
caristu 
AugustoMauch 
highminoralways
closedfixed 
5
pi 
3.0PR15Q13.0PR15Q1 
alostale
Core
No
0027829: Grids in parameter windows based on HQL query tables don't work properly depending on the column order
The new parameter windows can display grids based on HQL Query tables.

In order this grids to work well the order of the columns in the hql query, sequence number of the table columns in AD and sequence number of the window fields in AD must be the same. Otherwise, in the first field it shows the first column of the query, even if it does not belong to the column in AD related to it.
1) Go to the [Tables and Columns] window and create a new column for the aprm_orderinvoice table. Put 1 as sequence number.
2) Go to the [Windows, Tabs and fields], navigate to the "Order Invoice P&E" and create a new field for the column created in step 1)
3) Modify the getSelectClause() method in the AddPaymentOrderInvoicesTransformer class to select a value for the column created in step 1). Put the new selected column at the end of the query
4) Execute ant smartbuild and restart tomcat
5) Go to the [Sales Invoice] window and click on the "Add Payment" button. Notice that the values are not being displayed on the correct field.
6) Modify the query and put the new column at the first position. Now everything works fine because the order of the column in the hql query, sequence number of the table column in AD and sequence number of the window field in AD is the same
No tags attached.
Issue History
2014-10-10 12:00caristuNew Issue
2014-10-10 12:00caristuAssigned To => AugustoMauch
2014-10-10 12:00caristuModules => Core
2014-10-10 12:00caristuResolution time => 1419289200
2014-10-10 12:00caristuTriggers an Emergency Pack => No
2014-10-10 12:17caristuIssue Monitored: networkb
2014-10-10 12:18caristuversion => pi
2014-11-10 10:52alostaleAssigned ToAugustoMauch => NaroaIriarte
2014-11-10 10:52alostaleAssigned ToNaroaIriarte => AugustoMauch
2014-11-26 13:50AugustoMauchIssue Monitored: alostale
2014-11-26 13:51AugustoMauchReview Assigned To => alostale
2014-11-26 13:51hgbotCheckin
2014-11-26 13:51hgbotNote Added: 0072032
2014-11-26 13:51hgbotStatusnew => resolved
2014-11-26 13:51hgbotResolutionopen => fixed
2014-11-26 13:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/30e8d84ac147104b91533bc7a68235dc69ba06f8 [^]
2014-12-01 12:31alostaleNote Added: 0072190
2014-12-01 12:31alostaleStatusresolved => closed
2014-12-01 12:31alostaleFixed in Version => 3.0PR15Q1
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073148

Notes
(0072032)
hgbot   
2014-11-26 13:51   
Repository: erp/devel/pi
Changeset: 30e8d84ac147104b91533bc7a68235dc69ba06f8
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Nov 26 13:47:58 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/30e8d84ac147104b91533bc7a68235dc69ba06f8 [^]

Fixes issue 27829: Column order definition in HQL tables does not matter

There was already a mechanism in place to support that the order of the columns in the HQL query is different from the order of the columns in the application dictionary. The problem was that this mechanism was not working properly when the column aliases had uppercase characters, due to a missimg .toLowercase statement in the Entity.getPropertyByColumnName method. Due to this bug the HQLDataSourceService was not able to find the properties of the entity based on the column alias, and was instead using the index of the column to pick the value from the result array, making the column order relevant.

---
M src/org/openbravo/base/model/Entity.java
---
(0072190)
alostale   
2014-12-01 12:31   
Code reviewed.

Tested by changing column position and using lower/upper cases
(0073148)
hudsonbot   
2014-12-30 23:26   
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/6525fe229e06 [^]
Maturity status: Test