Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0038842 | Openbravo ERP | Z. Others | public | 2018-06-26 16:40 | 2022-02-01 07:24 |
Reporter | matias-bernal | ||||
Assigned To | Triage Platform Base | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | OS | 5 | OS Version | ||
Product Version | pi | ||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | |||||
Web browser | |||||
Modules | JSON Datasource | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0038842: Exception occurs when converting JSON to Base OB Object when JSON contains "updated" property, and object is new | ||||
Description | When using the Openbravo classes to convert JSON to BaseOBObject (JSONToDataConverter.java), you get an exception if the original JSON has an (non null) property with name: updated. The problem is when the code checks the dates of the "current" object versus the one of the JSON, to avoid an update when the record has been updated by other process. If the BaseOBObject is new, then the object's updated property is null (has not been set yet), then the validation between dates fails with a NPE. | ||||
Steps To Reproduce | 1. Use JSON REST Webservices and send a POST to any writable entity, with all the required properties set (for example, Order). 2. Make sure your JSON has an "updated" field with a date. 3. Send the request. 4. An error should be returned by the web service: "Exception updating Order(null)". Logs show more detailed exceptions 5. Remove the "updated" property from the JSON. 6. Now the JSON should generate the entity properly. Alternatively, create a simple class that makes use of the JsonToDataConverter, and tries to convert to BaseOBObject, a JSON with the updated property set. | ||||
Proposed Solution | Move the date validations after the updated property is set to the new object, or make sure that this validation is not done on new objects. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2018-06-26 16:40 | matias-bernal | New Issue | |||
2018-06-26 16:40 | matias-bernal | Assigned To | => Triage Finance | ||
2018-06-26 16:40 | matias-bernal | Modules | => JSON Datasource | ||
2018-06-26 16:40 | matias-bernal | Resolution time | => 1532401200 | ||
2018-06-26 16:40 | matias-bernal | Triggers an Emergency Pack | => No | ||
2018-06-26 16:41 | matias-bernal | Issue Monitored: achaves | |||
2018-06-26 16:42 | matias-bernal | Issue Monitored: szapata | |||
2018-07-25 17:18 | collazoandy4 | Assigned To | Triage Finance => collazoandy4 | ||
2018-08-06 14:48 | ngarcia | Resolution time | 1532401200 => | ||
2019-10-14 15:07 | Sandrahuguet | Assigned To | collazoandy4 => Triage Finance | ||
2019-12-19 13:18 | dmiguelez | Assigned To | Triage Finance => platform | ||
2022-02-01 07:24 | alostale | Assigned To | platform => Triage Platform Base |
There are no notes attached to this issue. |