Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007805Openbravo ERPA. Platformpublic2009-02-24 19:472009-07-26 22:43
gorka_gil 
alostale 
urgentcriticalalways
closedfixed 
302.6.27-gentoo-r7
2.50beta 
2.50MP3 
Core
No
0007805: Unistall a module with ad_process fails
Unistalling Hello World Process shows an error of database:

Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "ad_process" violates foreign key constraint "ad_process_request_ad_process" on table "ad_process_request"
  Detail: Key (ad_process_id)=(0202F5D291A84E9D9DF9EFD75FEB5E30) is still referenced from table "ad_process_request".
1. Install and rebuild Hello World Process
2. Add a new record in its window and press the button.
3. Uninstall the module

Fails and shows the error.
250MP3releasecandidate
has duplicate defect 0008023main closed alostale cannot uninstall a refence data module that has been already applied 
related to defect 00207433.0MP13 closed marvintm Reference data error appears when i rebuild the system after installing spanish localization pack 
log 20090224193513-apply.log (43,062) 2009-02-24 19:53
https://issues.openbravo.com/file_download.php?file_id=935&type=bug
Issue History
2009-02-24 19:47gorka_gilNew Issue
2009-02-24 19:47gorka_gilAssigned To => marvintm
2009-02-24 19:47gorka_gilFile Added: 20090224193930-apply.log
2009-02-24 19:47gorka_gilRegression testing => No
2009-02-24 19:53gorka_gilFile Deleted: 20090224193930-apply.log
2009-02-24 19:53gorka_gilFile Added: 20090224193513-apply.log
2009-02-24 22:22pjuvaraversion => 2.50beta
2009-02-25 07:45pjuvaraNote Added: 0014043
2009-02-25 07:45pjuvaraPriorityhigh => urgent
2009-02-25 07:45pjuvaraSeverityminor => critical
2009-02-25 08:58alostaleNote Added: 0014046
2009-02-25 09:40alostaleAssigned Tomarvintm => alostale
2009-02-25 13:57alostaleStatusnew => scheduled
2009-02-25 13:57alostalefix_in_branch => trunk
2009-02-25 13:57alostaleStatusscheduled => resolved
2009-02-25 13:57alostaleFixed in Version => trunk
2009-02-25 13:57alostalesvn_revision => 3633
2009-02-25 13:57alostaleResolutionopen => fixed
2009-03-09 12:16alostaleRelationship addedhas duplicate 0008023
2009-04-21 10:33psarobeStatusresolved => closed
2009-04-22 00:00anonymoussf_bug_id0 => 2778006
2009-07-03 13:10hgbotCheckin
2009-07-03 13:10hgbotNote Added: 0017790
2009-07-03 13:10hgbotStatusclosed => resolved
2009-07-03 13:10hgbotFixed in SCM revision3633 => http://code.openbravo.com/erp/devel/pi/rev/4930b9515f5167311d198cc6b06568f6262779e4 [^]
2009-07-21 16:24psarobeFixed in Version2.50 => 2.50MP3
2009-07-21 16:26psarobeTag Attached: 250MP3releasecandidate
2009-07-26 22:43psarobeStatusresolved => closed
2012-06-19 15:30alostaleRelationship addedrelated to 0020743

Notes
(0014043)
pjuvara   
2009-02-25 07:45   
Upgrading severity and priority as these are showstoppers for releasing beta.
(0014046)
alostale   
2009-02-25 08:58   
The problem is that when executing the action a new record in ad_process_request is created. This record is not part of the module so when uninstalling the module it is not removed and when trying to enable the constraints it is not possible because the referred record (which was in the module) does not longer exist.

We should ensure that in these cases the information not in module is also removed (would an on delete cascade be enough) when removing the parent record.

There are 25 cases that should also be reviewed, this Oracle query detects them:

select c1.table_name MODULE_REFERRED_TABLE,c.table_name NOT_MODULE_TABLE
from user_constraints c,
     user_constraints c1,
     ad_dataset_table s,
     ad_table t
where c.constraint_type='R'
  and c1.constraint_name = c.r_constraint_name
  and s.ad_dataset_id = '0'
  and s.ad_table_id = t.ad_table_id
  and c1.table_name = upper(t.tablename)
  and c.delete_rule !='CASCADE'
  and not exists (select 1
                    from ad_dataset_table dt, ad_table t1
                  where dt.ad_dataset_id = '0'
                    and t1.ad_table_id = dt.ad_table_id
                    and c.table_name = upper(t1.tablename))
order by 1,2;
(0017790)
hgbot   
2009-07-03 13:10   
Repository: erp/devel/pi
Changeset: 4930b9515f5167311d198cc6b06568f6262779e4
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Feb 25 10:55:02 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/4930b9515f5167311d198cc6b06568f6262779e4 [^]

fixed bug 0007805: Unistall a module with ad_process fails

---
M src-db/database/model/tables/AD_ALERTRULE.xml
M src-db/database/model/tables/AD_ATTACHMENT.xml
M src-db/database/model/tables/AD_CHANGELOG.xml
M src-db/database/model/tables/AD_CLIENTMODULE.xml
M src-db/database/model/tables/AD_COLUMN_ACCESS.xml
M src-db/database/model/tables/AD_DIMENSION.xml
M src-db/database/model/tables/AD_IMPFORMAT.xml
M src-db/database/model/tables/AD_IMPFORMAT_ROW.xml
M src-db/database/model/tables/AD_NOTE.xml
M src-db/database/model/tables/AD_ORGMODULE.xml
M src-db/database/model/tables/AD_PREFERENCE.xml
M src-db/database/model/tables/AD_PROCESS_REQUEST.xml
M src-db/database/model/tables/AD_PROCESS_SCHEDULING.xml
M src-db/database/model/tables/AD_RECORD_ACCESS.xml
M src-db/database/model/tables/AD_REF_DATA_LOADED.xml
M src-db/database/model/tables/C_ACCTSCHEMA_TABLE.xml
M src-db/database/model/tables/C_DOCTYPE.xml
M src-db/database/model/tables/C_FILE.xml
M src-db/database/model/tables/FACT_ACCT.xml
M src-db/database/model/tables/I_ELEMENTVALUE.xml
---