Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040673Openbravo ERP04. Warehouse managementpublic2019-04-24 13:062019-04-26 10:13
Sandrahuguet 
Sandrahuguet 
normalmajorhave not tried
closedfixed 
30Openbravo Appliance 14.04
 
3.0PR18Q4.43.0PR18Q4.4 
dmiguelez
Core
Production - Confirmed Stable
2018-07-24
3.0PR18Q4
https://code.openbravo.com/erp/devel/pi/rev/95dcfa93d706654e1fbddfc3966bec7280081ac1 [^]
No
0040673: Generate Aggregated Data Background process fail
Generate Aggregated Data Background process fail:

2019-04-24 13:04:31,985 [DefaultQuartzScheduler_Worker-4] ERROR org.openbravo.materialmgmt.GenerateAggregatedDataBackground - org.openbravo.model.common.enterprise.Organization cannot be cast to java.lang.String
java.lang.ClassCastException: org.openbravo.model.common.enterprise.Organization cannot be cast to java.lang.String
    at org.hibernate.type.descriptor.java.StringTypeDescriptor.unwrap(StringTypeDescriptor.java:22) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1.doBind(VarcharTypeDescriptor.java:46) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:74) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:280) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:275) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:53) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:645) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:2000) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1914) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1892) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.doQuery(Loader.java:937) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:340) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.doList(Loader.java:2689) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.doList(Loader.java:2672) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2506) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.Loader.list(Loader.java:2501) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:504) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:395) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:220) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1508) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1537) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1505) ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.openbravo.dal.service.OBQuery.list(OBQuery.java:123) ~[classes/:?]
    at org.openbravo.materialmgmt.ResetValuedStockAggregated.costingRuleDefindedForPeriod(ResetValuedStockAggregated.java:245) ~[classes/:?]
    at org.openbravo.materialmgmt.GenerateAggregatedDataBackground.doExecute(GenerateAggregatedDataBackground.java:105) [classes/:?]
    at org.openbravo.service.db.DalBaseProcess.execute(DalBaseProcess.java:85) [classes/:?]
    at org.openbravo.scheduling.DefaultJob.execute(DefaultJob.java:65) [classes/:?]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-1.6.2.jar:1.6.2]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525) [quartz-1.6.2.jar:1.6.2]

The failure is caused by:
http://wiki.openbravo.com/wiki/Hibernate_5.3_Migration_Guide#Comparing_Business_Objects_and_IDs_with_Query_Parameters [^]
Go to process request and create new record:
 -Client: F&B International Group
 -Organization: F&B EspaƱa, S.A
 -Process: Generate Aggregated Data Background
 -Timing: Run Immediately
Schedule Process, notice that the process fail
No tags attached.
blocks defect 0040670 closed Sandrahuguet Generate Aggregated Data Background process fail 
Issue History
2019-04-24 13:26SandrahuguetTypedefect => backport
2019-04-24 13:26SandrahuguetTarget Version => 3.0PR18Q4.4
2019-04-25 10:16hgbotCheckin
2019-04-25 10:16hgbotNote Added: 0111301
2019-04-25 10:16hgbotStatusscheduled => resolved
2019-04-25 10:16hgbotResolutionopen => fixed
2019-04-25 10:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR18Q4.4/rev/8473ad1b82cd10fcc874baa517bb1ead113c8934 [^]
2019-04-26 10:13dmiguelezReview Assigned To => dmiguelez
2019-04-26 10:13dmiguelezNote Added: 0111348
2019-04-26 10:13dmiguelezStatusresolved => closed
2019-04-26 10:13dmiguelezFixed in Version => 3.0PR19Q3
2019-04-26 10:13dmiguelezFixed in Version3.0PR19Q3 => 3.0PR18Q4.4

Notes
(0111301)
hgbot   
2019-04-25 10:16   
Repository: erp/backports/3.0PR18Q4.4
Changeset: 8473ad1b82cd10fcc874baa517bb1ead113c8934
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Thu Apr 25 10:06:44 2019 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q4.4/rev/8473ad1b82cd10fcc874baa517bb1ead113c8934 [^]

Fixed issue 40673 Fix query to compare organization with corresponding id.

Fix query to compare organization with corresponding id instead of the
business object.

Fix wrong filter date, period.getEndingDate() is used and the correct
one is period.getStartingDate().

---
M src/org/openbravo/materialmgmt/ResetValuedStockAggregated.java
---
(0111348)
dmiguelez   
2019-04-26 10:13   
Code Review + Testing Ok