Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0011812Openbravo ERPA. Platformpublic2009-12-17 14:032010-01-06 00:00
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
pi 
pi 
Core
No
0011812: Implement more lenient handling of decimal numbers which can correctly be converted to a long for a changed reference
The reference for a several columns has changed from a decimal number to an integer (from reference 22 to reference id 11).
See this changeset:
https://code.openbravo.com/erp/devel/pi/rev/9e660d4a5c4a [^]

The XML import should be more lenient in that if it can convert a decimal number to a long without changing the number it should do so. Currently (without this change) the xml import fails with a stack trace like this:
     [java] org.openbravo.dal.xml.EntityXMLException: Value 24.0 can not be parsed to an instance of class java.lang.Long
     [java] at org.openbravo.dal.xml.XMLTypeConverter.fromXML(XMLTypeConverter.java:166)
     [java] at org.openbravo.dal.xml.XMLEntityConverter.processEntityElement(XMLEntityConverter.java:213)
     [java] at org.openbravo.dal.xml.XMLEntityConverter.process(XMLEntityConverter.java:123)
     [java] at org.openbravo.service.db.DataImportService.importDataFromXML(DataImportService.java:409)
     [java] at org.openbravo.service.db.DataImportService.importDataFromXML(DataImportService.java:125)
     [java] at org.openbravo.erpCommon.modules.ApplyModule.execute(ApplyModule.java:162)
     [java] at org.openbravo.erpCommon.modules.ApplyModuleTask.doExecute(ApplyModuleTask.java:58)
     [java] at org.openbravo.dal.core.DalInitializingTask.execute(DalInitializingTask.java:120)
     [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
     [java] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] at java.lang.reflect.Method.invoke(Method.java:616)
     [java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java] at org.apache.tools.ant.Task.perform(Task.java:348)
     [java] at org.apache.tools.ant.Target.execute(Target.java:357)
     [java] at org.apache.tools.ant.Target.performTasks(Target.java:385)
     [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
     [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
     [java] at org.openbravo.erpCommon.utility.AntExecutor.runTask(AntExecutor.java:225)
     [java] at org.openbravo.erpCommon.modules.ApplyModuleTask.main(ApplyModuleTask.java:44)
Allow conversion which does not change the value so:
24.0 --> 24
24.5 --> exception (can not be converted to long without changing the value)
No tags attached.
Issue History
2009-12-17 14:03mtaalNew Issue
2009-12-17 14:03mtaalAssigned To => mtaal
2009-12-17 14:22hgbotCheckin
2009-12-17 14:22hgbotNote Added: 0022917
2009-12-17 14:22hgbotStatusnew => resolved
2009-12-17 14:22hgbotResolutionopen => fixed
2009-12-17 14:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1211a3da302e613c60a17b9c28061a83e9ed8afd [^]
2009-12-19 00:36hudsonbotCheckin
2009-12-19 00:36hudsonbotNote Added: 0022958
2010-01-05 11:33iperdomoNote Added: 0023220
2010-01-05 11:33iperdomoStatusresolved => closed
2010-01-06 00:00anonymoussf_bug_id0 => 2926547

Notes
(0022917)
hgbot   
2009-12-17 14:22   
Repository: erp/devel/pi
Changeset: 1211a3da302e613c60a17b9c28061a83e9ed8afd
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Dec 17 14:22:03 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1211a3da302e613c60a17b9c28061a83e9ed8afd [^]

fixes issue 11812: Implement more lenient handling of decimal numbers which can correctly be converted to a long for a changed reference

---
M src-test/org/openbravo/test/dal/IssuesTest.java
M src/org/openbravo/dal/xml/XMLTypeConverter.java
---
(0022958)
hudsonbot   
2009-12-19 00:36   
---
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/1211a3da302e [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/867059305a34 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/obx/core/OpenbravoERP-2.50CI.15773.obx [^]
---
(0023220)
iperdomo   
2010-01-05 11:33   
Tested on pi @ rev cb3804b67363