Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0028432
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2014-12-17 10:182014-12-30 23:28
ReporteralostaleView Statuspublic 
Assigned ToAugustoMauch 
PriorityimmediateResolutionfixedFixed in Version3.0PR15Q1
StatusclosedFix in branchFixed in SCM revision95dd177fbbc7
ProjectionnoneETAnoneTarget Version3.0PR15Q1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todbaz
Web browser
ModulesCore
Regression levelCoding ( Testing )
Regression date2014-11-25
Regression introduced in releasepi
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/059f8 [^]
Triggers an Emergency PackNo
Summary

0028432: can't filter product FK drop down in return windows P&E

DescriptionIn "Return from Customer"/"Return to Vendor" windows, "Pick Lines" process, when there is a translation installed it is not possible to filter product name in FK drop down list.
Steps To Reproduce-Install Spanish Translation
-Go to "Return to Vendor" window (no matter if session language is English or Spanish)
-Create a line
-Click on "Pick/Edit Lines" button
-Type "a" in the product filter
  -Drop down list is opened (OK)
  -"No items to show" message is displayed -> Error
  -This error can appears is log
1f923ef8 1716159 [http-8080-2] ERROR org.openbravo.client.kernel.KernelUtils - unexpected token: t near line 1, column 2622 [select iol.id as id, iol.organization as organization, iol.client as client, iol.product as product, iol.uOM as uOM, iol.id as goodsShipmentLine, iol.movementQuantity as movementQuantity, iol.shipmentReceipt.businessPartner as businessPartner, iol.shipmentReceipt.documentNo as shipmentNumber, iol.shipmentReceipt.movementDate as movementDate, attributeSetValue as attributeSetValue, coalesce((select sum(ol.orderedQuantity) from OrderLine as ol left join ol.salesOrder as o where ol.goodsShipmentLine = iol and o.processed = true and o.documentStatus <> 'VO'), 0) as returnQtyOtherRM, (case when (select ('Y') from OrderLine as ol where ol.salesOrder.id = :salesOrderId and ol.goodsShipmentLine = iol) is null then false else true end) as obSelected, coalesce((select ol.orderedQuantity from OrderLine as ol where ol.salesOrder.id = :salesOrderId and ol.goodsShipmentLine = iol),0)*(-1) as returned, (select ol.returnReason from OrderLine as ol where ol.salesOrder.id = :salesOrderId and ol.goodsShipmentLine = iol) as returnReason, coalesce((select ol.tax from OrderLine as ol where ol.salesOrder.id = :salesOrderId and ol.goodsShipmentLine = iol) , (select e.salesOrderLine.tax from ProcurementPOInvoiceMatch as e where e.goodsShipmentLine = iol)) as tax, (case when (select e.salesOrderLine.salesOrder.priceList.priceIncludesTax from ProcurementPOInvoiceMatch as e where e.goodsShipmentLine = iol) = true then coalesce((select ol.unitPrice from OrderLine as ol where ol.salesOrder.id = :salesOrderId and ol.goodsShipmentLine = iol), (select e.salesOrderLine.grossUnitPrice from ProcurementPOInvoiceMatch as e where e.goodsShipmentLine = iol)) else coalesce((select ol.unitPrice from OrderLine as ol where ol.salesOrder.id = :salesOrderId and ol.goodsShipmentLine = iol), (select e.salesOrderLine.unitPrice from ProcurementPOInvoiceMatch as e where e.goodsShipmentLine = iol)) end) as unitPrice, (select e.salesOrderLine.salesOrder.documentNo from ProcurementPOInvoiceMatch as e where e.goodsShipmentLine = iol) as orderNo FROM MaterialMgmtShipmentInOutLine as iol left join iol.attributeSetValue as attributeSetValue join iol.shipmentReceipt as io where io.businessPartner.id = :businessPartnerId and io.processed = true and io.documentStatus <> 'VO' and io.salesTransaction = false and 1 = 1 and iol.client.id in ('0', '23C59575B9CF467C9620760EB255B389') AND iol.organization in ('E443A31992CB4635AFCAEABE7183CE85','0','19404EAD144C49A0AF37D54377CF452D','B843C30461EA4501935CB1D125C9C25A') AND ( iol.id = :alias_0 or upper((COALESCE(to_char((select name from ProductTrl as t t.product = product and t.language.language='en_US')), to_char(iol.product.name), ''))) like upper(:alias_1) escape '|' ) AND (io.movementDate >= (now() - 90) or (case when (select ('Y') from OrderLine as ol where ol.salesOrder.id = :salesOrderId and ol.goodsShipmentLine = iol) is null then false else true end) = true) ORDER BY obSelected desc, obSelected desc, io.movementDate desc, io.documentNo desc, iol.lineNo]

TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 00259963.0PR14Q3 closedAugustoMauch HQL based tables 
causes defect 0028545 closedalostale Some filters in Grids built on HQL Based Table they don't work any more 
causes defect 0029212 closedAugustoMauch can't filter multiple products in return from/to P&Es 
causes defect 0029224 closedAugustoMauch can't filter by Return Reason in Return P&E windows 
causes defect 0029241 closedAugustoMauch can't filter by Attribute Set Value in Return P&E windows 

-  Notes
(0072692)
alostale (manager)
2014-12-18 11:08
edited on: 2014-12-18 11:09

The problem is in HQLDataSourceService.addAdditionalFilters method. In this case the filterWhereClauseParameter is:

 where ( upper((COALESCE(to_char((select name from ProductTrl as t where t.product = product and t.language.language='en_US')), to_char(iol.product.name), ''))) like upper(:alias_0) escape '|' )

In line 555 all occurrences of where are removed, resulting in:

 ( upper((COALESCE(to_char((select name from ProductTrl as t t.product = product and t.language.language='en_US')), to_char(iol.product.name), ''))) like upper(:alias_0) escape '|' )

Note the subquery is no valid anymore, it is:

... from ProductTrl as t t.product=...

but it should be

... from ProductTrl as t ***where*** t.product=...

Should we remove just the initial where instead of all of them or is there any case where this is not correct?

(0072779)
AugustoMauch (manager)
2014-12-22 19:15

Fix pushed to try.
(0072787)
hgbot (developer)
2014-12-23 09:42

Repository: erp/devel/pi
Changeset: 95dd177fbbc7f18d448b3e31cc12b67dbc0cb87d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Dec 22 19:14:54 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/95dd177fbbc7f18d448b3e31cc12b67dbc0cb87d [^]

Fixes issue 28432: HQLDataSourceService manages translations properly

There were several problems related with the handling of translatable columns in the HQLDataSourceService class:
- If there was a translation installed, the query done to retrieve some data that contained a translatable column threw an exception. This was because the WHERE constant of the inner query done to retrieve the translated string was being removed. The regex that handled this has been improved so that now only the leading WHERE constant is removed.
- After fixing that the query no longer threw an exception but it did not return the proper results. This happened because the query was not properly built, due to not using the entity alias in the query builder.
- After that, the translated string was not being shown when the filter drop down was populated. This has been fixed by changing the way this information is obtained. Previously only the id and the (not translated) identifier was obtained using the query. Now the whole BaseOBObject is retrieved, and it is used later to obtain its id and its potentially tranlated identifier.

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java
---
(0072788)
AugustoMauch (manager)
2014-12-23 09:51

Test plan:
- Install the spanish localization pack. There is no need to set Spanish as the systems default language.
- Open the Pick&Execute window of Return to Customer and clear the filters. Choose any product you see there, and add a translation to it in the Translation subtab of the Product window.
- Open the Pick&Execute window again, now the name of the product should be the translated one.
- Open the filter drop down of the Product column, the name of the product should be the translated one.
- Try filtering translated and not translated columns.
(0072800)
dbaz (developer)
2014-12-23 16:36

Reviewed @ changeset: 25592 - dd9596bfd555
(0073260)
hudsonbot (developer)
2014-12-30 23:28

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

- Issue History
Date Modified Username Field Change
2014-12-17 10:18 alostale New Issue
2014-12-17 10:18 alostale Assigned To => alostale
2014-12-17 10:18 alostale Modules => Core
2014-12-17 10:18 alostale Regression level => Coding ( Testing )
2014-12-17 10:18 alostale Regression introduced in release => pi
2014-12-17 10:18 alostale Triggers an Emergency Pack => No
2014-12-17 10:19 alostale Priority normal => immediate
2014-12-17 15:54 alostale Summary can't filter product in return windows => can't filter product FK drop down in return windows P&E
2014-12-18 10:57 alostale Relationship added related to 0025996
2014-12-18 11:02 alostale Regression date => 2014-11-25
2014-12-18 11:02 alostale Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/059f8 [^]
2014-12-18 11:08 alostale Note Added: 0072692
2014-12-18 11:09 alostale Assigned To alostale => AugustoMauch
2014-12-18 11:09 alostale Note Edited: 0072692 View Revisions
2014-12-22 19:15 AugustoMauch Note Added: 0072779
2014-12-23 09:30 AugustoMauch Issue Monitored: dbaz
2014-12-23 09:31 AugustoMauch Review Assigned To => dbaz
2014-12-23 09:42 hgbot Checkin
2014-12-23 09:42 hgbot Note Added: 0072787
2014-12-23 09:42 hgbot Status new => resolved
2014-12-23 09:42 hgbot Resolution open => fixed
2014-12-23 09:42 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/95dd177fbbc7f18d448b3e31cc12b67dbc0cb87d [^]
2014-12-23 09:51 AugustoMauch Note Added: 0072788
2014-12-23 16:36 dbaz Note Added: 0072800
2014-12-23 16:36 dbaz Status resolved => closed
2014-12-23 16:36 dbaz Fixed in Version => 3.0PR15Q1
2014-12-30 23:28 hudsonbot Checkin
2014-12-30 23:28 hudsonbot Note Added: 0073260
2015-01-09 09:51 alostale Relationship added causes 0028545
2015-03-10 10:33 alostale Relationship added causes 0029212
2015-03-10 19:18 AugustoMauch Relationship added causes 0029224
2015-03-10 19:18 AugustoMauch Relationship added causes 0029225
2015-03-11 11:26 AugustoMauch Relationship added causes 0029241


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker