Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012078Openbravo ERP02. Master data managementpublic2010-01-27 16:102010-10-14 00:00
mgerke 
harikrishnan 
normalminoralways
closedfixed 
20Community Appliance
2.50 
2.50MP23 
Core
No
0012078: Business partner could not be deleted because of a constraint
Business partner could not be deleted because of a constraint, if there is a Contact (=> Contact Tab) defined.

Openbravo error message is:
"This record cannot be deleted because it is associated with other existing elements. Please see Linked Items"

Tomcat log (translated from german):
Update or delete in table »c_bpartner« violates
foreign key constraint »cbpartner_aduser« on table »ad_user«
Detail: There is a reference on (c_bpartner_id)=(3A6DE4E9A61D4EC398C8B5B78D14BA90) from table »ad_user«

If other information like "bank account" is defined, business partners could be deleted.

new business partner
new contact

delete business partner
No tags attached.
related to defect 0014766 closed harikrishnan try-api 191 fails with a warning 
Issue History
2010-01-27 16:10mgerkeNew Issue
2010-01-27 16:10mgerkeAssigned To => mtaal
2010-01-27 16:56mtaalNote Added: 0023835
2010-01-27 16:56mtaalStatusnew => feedback
2010-02-03 10:11mgerkeNote Added: 0023918
2010-02-03 10:18mtaalAssigned Tomtaal => rafaroda
2010-02-03 10:18mtaalNote Added: 0023919
2010-02-16 15:29rafarodaAssigned Torafaroda => mtaal
2010-02-16 15:30rafarodaProjectModules => Openbravo ERP
2010-02-16 15:30rafarodaAssigned Tomtaal => adrianromero
2010-02-16 15:30rafarodaStatusfeedback => new
2010-02-16 15:30rafarodaCategoryMulti-Business Partner Selector => 02. Master data management
2010-02-16 15:31rafarodaNote Added: 0024416
2010-08-21 14:36Jan De Bruyne - AbbossIssue Monitored: Jan De Bruyne - Abboss
2010-08-21 14:40Jan De Bruyne - AbbossNote Added: 0030208
2010-08-23 09:40shuehnerNote Added: 0030214
2010-08-29 15:53Jan De Bruyne - AbbossNote Added: 0030428
2010-10-05 13:49shuehnerRelationship addedrelated to 0014766
2010-10-06 08:14harikrishnanAssigned Toadrianromero => harikrishnan
2010-10-11 08:27hgbotCheckin
2010-10-11 08:27hgbotNote Added: 0031727
2010-10-11 08:27hgbotStatusnew => resolved
2010-10-11 08:27hgbotResolutionopen => fixed
2010-10-11 08:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ecd5a5db58bd257cad9e08034a5e10fb0459eb44 [^]
2010-10-11 08:31harikrishnanNote Added: 0031729
2010-10-11 15:18hudsonbotCheckin
2010-10-11 15:18hudsonbotNote Added: 0031764
2010-10-13 17:18psarobeNote Added: 0031819
2010-10-13 17:18psarobeStatusresolved => closed
2010-10-13 17:18psarobeFixed in Version => 2.50MP23
2010-10-14 00:00anonymoussf_bug_id0 => 3086961

Notes
(0023835)
mtaal   
2010-01-27 16:56   
Hi Mgerke,
Question, is there a specific reason that you report this issue on the multiple business partner selector module. That module only allows selecting business partner but not removing them.

In which part of the Openbravo application did you encounter this issue?

gr. Martin
(0023918)
mgerke   
2010-02-03 10:11   
Hi Martin, this is because I must do a selection of a category and I don't have other choices (more suitable) in the list of categories. If I had, I would choose "Business Partner Dialog".
(0023919)
mtaal   
2010-02-03 10:18   
Hi Rafa,
Can you assign it to someone who can answer/take care of this issue?

gr. Martin
(0024416)
rafaroda   
2010-02-16 15:31   
Moved to project Openbravo ERP > Category: Master Data Management and re-assigned to Adrián.
(0030208)
Jan De Bruyne - Abboss   
2010-08-21 14:40   
The same error
"This record cannot be deleted because it is associated with other existing elements. Please see Linked Items"
appears in MP20 while importing business partners (using Import File Loader).
No idea why Openbravo tries to delete records while it should import from CSV.
(0030214)
shuehner   
2010-08-23 09:40   
@Jan:
The same error message is shown in all foreign key violations, independent of inser/updated/delete. As when building the message we don't have the info which action it is.

Please open a new defect for the problem.
(0030428)
Jan De Bruyne - Abboss   
2010-08-29 15:53   
@shuehner:
Done (Issue 0014358).
(0031727)
hgbot   
2010-10-11 08:27   
Repository: erp/devel/pi
Changeset: ecd5a5db58bd257cad9e08034a5e10fb0459eb44
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Mon Oct 11 11:56:52 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ecd5a5db58bd257cad9e08034a5e10fb0459eb44 [^]

Fixes Issue 12078: Business partner could not be deleted because of a constraint

---
M src-db/database/model/tables/AD_USER.xml
---
(0031729)
harikrishnan   
2010-10-11 08:31   
Steps to test:
* Create a business partner with contact details and try to delete the business partner.Now the business partner can be deleted.

Root cause:

*Before Ondelete=cascade attribute is not used in the constraint.

Impact:
*API will be fail due to this fix.
(0031764)
hudsonbot   
2010-10-11 15:18   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/ecd5a5db58bd [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/f03dfdd6ea87 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18509.obx [^]
(0031819)
psarobe   
2010-10-13 17:18   
Tested working fine