Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015768Openbravo ERP02. Master data managementpublic2011-01-25 11:592015-05-14 11:01
dalsasua 
dmiguelez 
normalmajoralways
closedinvalid 
20Ubuntu 10.10
2.50 
 
Core
No
0015768: An organization cannot be deleted in postgresql
In Oracle, the trigger is executed before checking the constraints, so when deleting an organization, trigger code deletes the ad_treenode entry for that organization in the organizational tree (actually, was the same trigger the one that created it when creating the organization record). After that, the foreign key costraint on ADTreenode.AdOrgId column is checked. As postgresql does the other way arround (checks the constraint before executing the trigger), an error is shown (see attachment)
Create a new client
Logged with new client, create a new organization
Logout and login to be able to see the new organization
Try to delete it
Check that the error shown in the attachment is shown
Change the code in the trigger that deletes the ad_treenode entry with an on cascade for the foreign key? Must be studied...
VMA-Reviewed
has duplicate feature request 0007599 acknowledged rmorley New process: Delete Organization 
png ScreenShot.png (161,869) 2011-01-25 12:01
https://issues.openbravo.com/file_download.php?file_id=3545&type=bug
png
Issue History
2011-01-25 11:59dalsasuaNew Issue
2011-01-25 11:59dalsasuaAssigned To => adrianromero
2011-01-25 11:59dalsasuaModules => Core
2011-01-25 12:01dalsasuaFile Added: ScreenShot.png
2011-06-03 10:58dalsasuaAssigned Toadrianromero => dalsasua
2011-07-20 18:16dalsasuaAssigned Todalsasua => jonalegriaesarte
2012-02-15 19:05iciordiaAssigned Tojonalegriaesarte => vmromanos
2012-02-16 15:55vmromanosTag Attached: VMA-Reviewed
2012-05-10 12:13gorka_gilAssigned Tovmromanos => mirurita
2012-05-15 09:34SandrahuguetAssigned Tomirurita => Sandrahuguet
2012-05-15 09:36SandrahuguetStatusnew => scheduled
2012-05-15 09:36Sandrahuguetfix_in_branch => pi
2013-04-30 20:06hgbotCheckin
2013-04-30 20:06hgbotNote Added: 0058379
2013-04-30 20:06hgbotStatusscheduled => resolved
2013-04-30 20:06hgbotResolutionopen => fixed
2013-04-30 20:06hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ad7168af39fcc9888e44638c2a4844fcd19a896e [^]
2013-05-02 09:45dmiguelezAssigned ToSandrahuguet => dmiguelez
2013-05-02 09:45dmiguelezStatusresolved => new
2013-05-02 09:45dmiguelezResolutionfixed => open
2013-05-02 19:03hudsonbotCheckin
2013-05-02 19:03hudsonbotNote Added: 0058439
2015-05-14 11:01plujanNote Added: 0077433
2015-05-14 11:01plujanStatusnew => closed
2015-05-14 11:01plujanResolutionopen => invalid
2015-05-14 11:01plujanRelationship addedhas duplicate 0007599

Notes
(0058379)
hgbot   
2013-04-30 20:06   
Repository: erp/devel/pi
Changeset: ad7168af39fcc9888e44638c2a4844fcd19a896e
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Mon Apr 29 13:47:02 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ad7168af39fcc9888e44638c2a4844fcd19a896e [^]

Fixes Issue 15768. Executes trigger before deleting record.

---
M src-db/database/model/tables/AD_IMAGE.xml
M src-db/database/model/triggers/AD_ORG_TRG.xml
A src-db/database/model/triggers/AD_ORG_BEFORE_TRG.xml
---
(0058439)
hudsonbot   
2013-05-02 19:03   
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/b67b46460127 [^]

Maturity status: Test
(0077433)
plujan   
2015-05-14 11:01   
Deleting an organization requires a more complex procedure than regular deletions, similar to what happen with Delete Client. A Feature Request already exist about this.