Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0010238Openbravo ERP00. Application dictionarypublic2009-08-11 15:122009-08-20 00:00
AinhoaPagola 
mtaal 
normalmajorhave not tried
closedfixed 
20Ubuntu 8.4
 
pi 
Core
No
0010238: When a modules reference data is inserted, default value is set although NULL value is specified
When I insert the reference data of a module in the system, although I specified NULL value to be inserted, the default value has been inserted.


Example (can be seen in in HCM module)

- Create a process request and set daily options field to NULL. This field has a default value set to N in Application Dictionary. (Notice that in the database there is no default value)

- Create a dataset, with ad_process_request table, and set where field to id='the_process_request_id';

- Export the dataset

- The dataset has this line:
<dailyOption xsi:nil="true"/>

Still, when the module is installed and the reference data is installed, the inserted process request line has the column 'daily_option' set to N instead of NULL. 'N' is the default value set in the Application Dictionary.
If an optional column is set to NULL, NULL value should be inserted and not the default value.
No tags attached.
? org.openbravo.hcm.common-0.1.0.obx (232,271) 2009-08-11 15:12
https://issues.openbravo.com/file_download.php?file_id=1633&type=bug
Issue History
2009-08-11 15:12AinhoaPagolaNew Issue
2009-08-11 15:12AinhoaPagolaAssigned To => rafaroda
2009-08-11 15:12AinhoaPagolaFile Added: org.openbravo.hcm.common-0.1.0.obx
2009-08-11 15:12AinhoaPagolaAssigned Torafaroda => mtaal
2009-08-11 23:09mtaalNote Added: 0018917
2009-08-12 09:11AinhoaPagolaNote Added: 0018922
2009-08-13 16:11hgbotCheckin
2009-08-13 16:11hgbotNote Added: 0018935
2009-08-13 16:11hgbotStatusnew => resolved
2009-08-13 16:11hgbotResolutionopen => fixed
2009-08-13 16:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b7c077bd1a18a4bbc1324d5ca680c69252198e93 [^]
2009-08-19 12:07sureshbabuStatusresolved => closed
2009-08-19 12:07sureshbabuNote Added: 0019053
2009-08-19 12:07sureshbabuFixed in Version => pi
2009-08-20 00:00anonymoussf_bug_id0 => 2840625

Notes
(0018917)
mtaal   
2009-08-11 23:09   
A bug indeed. This can probably be solved by changing this line in the XMLEntityConverter:
if ((currentValue == null && newValue != null)
     || (currentValue != null && newValue != null && !currentValue.equals(newValue))) {

(line 221)
to something like this:
if ((currentValue == null && newValue != null)
     || (currentValue != null && newValue == null)
     || (currentValue != null && newValue != null && !currentValue.equals(newValue))) {

Can you try that?

gr. Martin
(0018922)
AinhoaPagola   
2009-08-12 09:11   
I tested this solution and solves the bug. Thanks a lot.
(0018935)
hgbot   
2009-08-13 16:11   
Repository: erp/devel/pi
Changeset: b7c077bd1a18a4bbc1324d5ca680c69252198e93
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Aug 13 16:11:01 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b7c077bd1a18a4bbc1324d5ca680c69252198e93 [^]

Fixed issue 10238. Now values will be correctly updated to NULL if they need to be.

---
M src/org/openbravo/dal/xml/XMLEntityConverter.java
---
(0019053)
sureshbabu   
2009-08-19 12:07   
Tested by installing the HCM obx file, Daily_option field rightly inserted with null.