Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021259Openbravo ERPA. Platformpublic2012-07-31 10:532012-09-26 17:19
shuehner 
marvintm 
normalmajorhave not tried
closedfixed 
5
pi 
3.0MP163.0MP16 
AugustoMauch
Core
No
0021259: export.sample.data/export-client fails with ad_ref_data* having rows pointing to no longer installed modules.
When installing modules containing datasets, and applying those datasets in a new client technically rows in the ad_ref_data* tables are created which among others have a field ad_module_id pointing to the module containing the datasets.

When now one of those modules are uninstalled this ad_module_id field still has a module-uuid but it is not pointing to a ad_module table row. This is allowed in db-level as intentionally no fk is in place for that column.

However dal when used by export.sample.data/export-client does check the FK relation and makes the export.sample.data fail.

Reproducible in current retail demo sampledata.
Install spanish pack + rebuild/restart
Create a new client and apply the datasets from the spanish pack in that new client
Uninstall all modules from the spanish pack + rebuild/restart
Try to export the client
DAL should not check this one reference same as it is not checked on db level.
No tags attached.
has duplicate defect 00215913.0MP16 closed marvintm AD_Module_Id column in AD_Ref_data_loaded should not have reference tabledir 
related to defect 0021260 acknowledged Triage Platform Base Error message in export.client/export.sample.data when FK is broken is not useful 
Issue History
2012-07-31 10:53shuehnerNew Issue
2012-07-31 10:53shuehnerAssigned To => alostale
2012-07-31 10:53shuehnerModules => Core
2012-07-31 10:57shuehnerRelationship addedrelated to 0021260
2012-08-02 14:01shuehnerAssigned Toalostale => marvintm
2012-09-11 12:35AugustoMauchFixed in Version => 3.0MP16
2012-09-11 12:36AugustoMauchRelationship addedhas duplicate 0021591
2012-09-11 19:35AugustoMauchFixed in Version3.0MP16 =>
2012-09-11 19:35AugustoMauchTarget Version => 3.0MP16
2012-09-12 11:38hgbotCheckin
2012-09-12 11:38hgbotNote Added: 0052013
2012-09-12 11:38hgbotStatusnew => resolved
2012-09-12 11:38hgbotResolutionopen => fixed
2012-09-12 11:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a8f432b843b5e8ddf6c9f6ef56254dcb46507944 [^]
2012-09-12 15:47AugustoMauchClosed by => AugustoMauch
2012-09-12 15:47AugustoMauchNote Added: 0052024
2012-09-12 15:47AugustoMauchStatusresolved => closed
2012-09-12 15:47AugustoMauchFixed in Version => 3.0MP16
2012-09-26 17:19hudsonbotCheckin
2012-09-26 17:19hudsonbotNote Added: 0052732

Notes
(0052013)
hgbot   
2012-09-12 11:38   
Repository: erp/devel/pi
Changeset: a8f432b843b5e8ddf6c9f6ef56254dcb46507944
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Wed Sep 12 11:37:41 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a8f432b843b5e8ddf6c9f6ef56254dcb46507944 [^]

Fixed issue 21259. Changed reference of module column in ad_ref_data_loaded to string.
Currently, the ad_module_id column in Ad_Ref_Data_Loaded has a tabledir reference. This actually doesn't make sense, as there could be records which point to a non-existant module (for example, if the module was uninstalled after its reference data has been applied).
Its reference therefore has been changed to string. This is an api change, but it's important to remark that the api was broken anyway (due to the reason just explained), and the change fixes a potential problem when importing a client which contains reference data which belongs to an uninstalled module.

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src/org/openbravo/service/db/DataImportService.java
---
(0052024)
AugustoMauch   
2012-09-12 15:47   
Code reviewed and verified in pi@07103a1a84bb
(0052732)
hudsonbot   
2012-09-26 17:19   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b780e90c6452 [^]

Maturity status: Test