Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027148
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2014-07-22 11:322014-08-08 18:53
ReportershuehnerView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR14Q4
StatusclosedFix in branchFixed in SCM revisiona1bf5514b421
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toshankarb
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027148: Module org.openbravo.module.resources cannot be uninstalled

DescriptionAt least in some cases that module is uninstallable.

This shows itself when having a db with that module used, then deleting the module folder and running update.database.
It fails with a fk-violation of an ad_tree entry pointing to a ad_table (obre_resource_category, B47E504D23D549A5A9CD9A9A426D20AF) shipped in that module.

As the ad_tree.ad_table-id fk is not defined as onDelete cascade this tree is not deleted and the module uninstall fails (note: only if some ad_tree entries to point to an ad_table of that module, not sure if that always is the case, but observed in at least 1 customer install).

However fixing that is not enough as the ad_tree pointing to that table are referenced from ad_clientinfo.AD_TREE_OBRE_RESOURCE_CATEGORY field.
Note those entries in ad_tree being referenced are auto-creaed by a modulescript.

Talking to vma he said that this field in ad_clientinfo is not used at all in core but only by this module. However it had to be added to core back then for technical reason.
Based on that it is find to add onDelete="setnull" to this field.

The combination of those 2 changes lets an update.db run suceed without error.
Steps To ReproduceTake pigrape1207 db available from shu
Combine it with sources of PR14Q2.4 + RR14Q2.1
run update.database

Maybe also reproducible by taking pi + installing that module
Then verifying that the auto-created ad_tree entries point to some ad_table in that module and that they are referenced by ad_clientinfo.

Having that fullfilled should be enough to trigger the uninstallation problem.
Proposed Solution- Add onDelete="cascade" to fk-definition in ad_tree pointing to ad_table
- Add onDelete="setnull" to fk-definition in ad_clientinfo of field AD_TREE_OBRE_RESOURCE_CATEGORY pointin to ad_tree
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 00224033.0MP18 closedvmromanos Add support for Resource Category tree 
related to feature request 00259063.0PR14Q2 closedAugustoMauch Tree Extension Project 
related to defect 00271523.0PR14Q4 closedalostale can't export to dataset tree nodes defined in new trees 

-  Notes
(0068792)
alostale (manager)
2014-07-22 12:14

It can be reproduced by installing org.openbravo.module.resources and its org.openbravo.portal.member.roles dependency in a fresh pi
(0068795)
hgbot (developer)
2014-07-22 12:31

Repository: erp/devel/pi
Changeset: a1bf5514b4218cf4a36c0353ff6e59f0c0e346aa
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jul 22 12:29:37 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a1bf5514b4218cf4a36c0353ff6e59f0c0e346aa [^]

fixed bug 27148: can't uninstall modules defining tree tables

---
M src-db/database/model/tables/AD_CLIENTINFO.xml
M src-db/database/model/tables/AD_TREE.xml
---
(0068994)
shankarb (reporter)
2014-07-31 06:31

Code reviewed and verified in pi changeset be933e11432c.
(0069207)
hudsonbot (developer)
2014-08-08 18:53

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/4450016dee64 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2014-07-22 11:32 shuehner New Issue
2014-07-22 11:32 shuehner Assigned To => AugustoMauch
2014-07-22 11:32 shuehner Modules => Core
2014-07-22 11:32 shuehner Triggers an Emergency Pack => No
2014-07-22 11:33 shuehner Proposed Solution updated
2014-07-22 11:34 shuehner Relationship added related to 0022403
2014-07-22 11:35 shuehner Relationship added related to 0025906
2014-07-22 11:50 alostale Assigned To AugustoMauch => alostale
2014-07-22 12:14 alostale Note Added: 0068792
2014-07-22 12:30 alostale Review Assigned To => shankarb
2014-07-22 12:31 hgbot Checkin
2014-07-22 12:31 hgbot Note Added: 0068795
2014-07-22 12:31 hgbot Status new => resolved
2014-07-22 12:31 hgbot Resolution open => fixed
2014-07-22 12:31 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a1bf5514b4218cf4a36c0353ff6e59f0c0e346aa [^]
2014-07-22 12:39 alostale Relationship added related to 0027152
2014-07-31 06:31 shankarb Note Added: 0068994
2014-07-31 06:31 shankarb Status resolved => closed
2014-07-31 06:31 shankarb Fixed in Version => 3.0PR14Q4
2014-08-08 18:53 hudsonbot Checkin
2014-08-08 18:53 hudsonbot Note Added: 0069207


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker