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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020635
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2012-05-30 09:472012-06-22 10:01
ReporterngarciaView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0MP13
StatusclosedFix in branchpiFixed in SCM revisiona067d7d80264
ProjectionnoneETAnoneTarget Version3.0MP14
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0020635: Cannot convert a date from a parameter of a widget to the HQL Query

DescriptionCannot convert a date from a parameter of a widget to the HQL Query
Steps To ReproduceAs system administrator:
  Go to the Widget screen and create a new record with Query/List as the Widget Superclass
  Go to the Parameters tab
  Create a record with the following info:
     DB Column Name: dateFrom (for example)
     Reference: Date
     Fixed: not checked
  Go tho Query tab and create a record with the following HQL (for example):
     select inv.id as invoiceId, inv.documentNo as documentNo
     from Invoice as inv
     where inv.invoiceDate = :dateFrom
  Go to Column subtab and add some columns for example with the following Display Column Aliases: documentNo and invoiceDate
  Go to the Workspace and add the widget

When choosing the date and clicking on Save the following exception is thrown:

ERROR org.openbravo.client.application.ParameterUtils - Error trying to set value for paramter: From
java.text.ParseException: Unparseable date: "2012-05-02"
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0049630)
hgbot (developer)
2012-06-05 19:20

Repository: erp/devel/pi
Changeset: f2db58a09d687182cc8f2e6df0b00cabbcf228e4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 05 19:19:17 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f2db58a09d687182cc8f2e6df0b00cabbcf228e4 [^]

Related to issue 20635: Date is parsed correctly

The date was not being parsed correctly because ParameterUtils was only supporting the yyyy-MM-dd'T'HH:mm:ss pattern, and the value was formatted with the yyy-MM-dd pattern.

Now, the method createFromString() of the DateDomainType is being used to parse the date. This method supports both patterns.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/ParameterUtils.java
---
(0049631)
AugustoMauch (manager)
2012-06-05 19:23

The previous fix is not enough to fix the issue. Now, even though the date is correctly parsed, the hibernate query fails, because it received the date as a String, but is expecting a Date.

This is due of the design of the class, which uses a Map<String, String> to represent the parameters of the widget.

To solve this, the reference of the parameters should be checked, and it they are dates, they should be converted from String to Date.
(0049632)
hgbot (developer)
2012-06-05 19:29

Repository: erp/devel/pi
Changeset: a067d7d8026469593bf767a93b46152ff2800862
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 05 19:28:42 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a067d7d8026469593bf767a93b46152ff2800862 [^]

Fixes issue 20635: date parameter works in Query/List widget

If a parameter is a Date, it is converted from its original class (String) to Date before setting the query parameter.

---
M modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java
---
(0049650)
hgbot (developer)
2012-06-06 15:32

Repository: erp/devel/pi
Changeset: eabe78fe0e7aff8b5ad8d3bb4a6605ce8bc933ba
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jun 06 15:31:19 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/eabe78fe0e7aff8b5ad8d3bb4a6605ce8bc933ba [^]

Related to issue 20635: a wrong property was being checked.

In the isDate method of QueryListDataSource, the field name was being used to check if a parameter was contained in the parameter list. This was wrong, the dbColumnName field is the one to be checked.

---
M modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java
---
(0049728)
ngarcia (developer)
2012-06-11 13:09

Verified
(0050022)
alostale (manager)
2012-06-22 10:01

code reviewed on pi@889f630ff69d

- Issue History
Date Modified Username Field Change
2012-05-30 09:47 ngarcia New Issue
2012-05-30 09:47 ngarcia Assigned To => alostale
2012-05-30 09:47 ngarcia Modules => Core
2012-05-30 09:47 ngarcia Resolution time => 1344808800
2012-06-04 11:51 alostale Assigned To alostale => AugustoMauch
2012-06-05 19:20 hgbot Checkin
2012-06-05 19:20 hgbot Note Added: 0049630
2012-06-05 19:23 AugustoMauch Note Added: 0049631
2012-06-05 19:29 hgbot Checkin
2012-06-05 19:29 hgbot Note Added: 0049632
2012-06-05 19:29 hgbot Status new => resolved
2012-06-05 19:29 hgbot Resolution open => fixed
2012-06-05 19:29 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a067d7d8026469593bf767a93b46152ff2800862 [^]
2012-06-06 15:32 hgbot Checkin
2012-06-06 15:32 hgbot Note Added: 0049650
2012-06-11 13:09 ngarcia Note Added: 0049728
2012-06-11 13:09 ngarcia Status resolved => closed
2012-06-11 13:47 AugustoMauch Status closed => new
2012-06-11 13:47 AugustoMauch Resolution fixed => open
2012-06-11 13:47 AugustoMauch Status new => scheduled
2012-06-11 13:47 AugustoMauch fix_in_branch => pi
2012-06-11 13:47 AugustoMauch Status scheduled => resolved
2012-06-11 13:47 AugustoMauch Resolution open => fixed
2012-06-12 12:56 ngarcia Issue Monitored: networkb
2012-06-22 10:01 alostale Note Added: 0050022
2012-06-22 10:01 alostale Status resolved => closed
2012-06-22 10:01 alostale Fixed in Version => 3.0MP13


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker