Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012225Openbravo ERP02. Master data managementpublic2010-02-11 11:202010-05-18 12:12
networkb 
harikrishnan 
highminoralways
closedfixed 
5
2.50MP11 
2.50MP17 
Core
No
0012225: Error when copying accounting configuration from BP group
In BP category > Accounting, it is possible to define multiple combinations for Accounting Schema, status, etc.
However, if same accounting schema and status is used, an error is shown:

c_bp_customer_acct_bpartner_un constraint fails.

Revising this constraint, is BP + Acct. Schema + Status.

The problem comes from C_BPartner_trg, first query returns duplicated records (Cur_Default)

Note: in order to reproduce this bug, it is really important to have fixed this bug:
https://issues.openbravo.com/view.php?id=11526 [^]
Go to General Setup > Enterprise > Organization.
Search * Organization.
Go to Org Schema tab.
Create a new record, and select Smallbazzar accounting schema.
Go to Master Data Management > Business Partner Setup > Business Partner Category.
Create a new one.
Go to Accounting tab.
Create a new record, for * organization and Smallbazaar accounting schema.
Select accounts (any) with * organization.
Select an status.
Create other record, for * organization and Smallbazaar accounting schema.
Select diferent accounts with * organization.
Select other status.
Create another record, for * organization and Smallbazaar accounting schema.
Select diferent accounts with * organization.
Select another status.
Go to Master Data Management > Business Partner. Create a new one, and select the previous BP category.
Save it.
No tags attached.
related to defect 00115262.50MP11 closed vinothbabu A BP only inherits one accounting of its BP category 
related to defect 00125882.50MP14 closed rajagopal If the same accounting schema is assigend for more than one org, a vendor is created with many entries on the accounting tab 
related to defect 00136362.50MP19 closed adrianromero If the same accounting schema is assigned for more than one org, a vendor is created with many entries on the accounting tab 
Issue History
2010-02-11 11:20networkbNew Issue
2010-02-11 11:20networkbAssigned To => adrianromero
2010-02-23 09:19networkbNote Added: 0024723
2010-02-23 09:19networkbStatusnew => feedback
2010-02-24 18:06networkbNote Added: 0024796
2010-02-24 18:06networkbStatusfeedback => new
2010-02-24 18:06networkbProposed Solution updated
2010-02-25 10:49adrianromeroNote Added: 0024809
2010-02-25 10:52adrianromeroStatusnew => scheduled
2010-02-25 10:52adrianromerofix_in_branch => pi
2010-03-08 16:05jpabloaeTarget Version2.50MP14 => 2.50MP15
2010-04-07 18:23adrianromeroNote Added: 0025957
2010-04-13 10:32networkbfix_in_branchpi =>
2010-04-13 10:32networkbDescription Updatedbug_revision_view_page.php?rev_id=229#r229
2010-04-13 10:32networkbSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=231#r231
2010-04-14 15:43dmitry_mezentsevNote Added: 0026189
2010-04-14 17:13adrianromeroRelationship addedrelated to 0011526
2010-04-22 06:22harikrishnanAssigned Toadrianromero => harikrishnan
2010-04-22 06:22hgbotCheckin
2010-04-22 06:22hgbotNote Added: 0026554
2010-04-22 06:22hgbotStatusscheduled => resolved
2010-04-22 06:22hgbotResolutionopen => fixed
2010-04-22 06:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ff1c64d7f68b5d987c47baa8f0e67f173ce5bcd4 [^]
2010-04-22 06:43harikrishnanNote Added: 0026557
2010-04-22 11:25dmitry_mezentsevNote Added: 0026562
2010-04-22 11:57adrianromeroRelationship addedrelated to 0012588
2010-04-22 12:01adrianromeroNote Added: 0026567
2010-04-22 12:01adrianromeroNote Edited: 0026567bug_revision_view_page.php?bugnote_id=0026567#r258
2010-04-22 12:11dmitry_mezentsevNote Added: 0026568
2010-04-22 16:15dmitry_mezentsevNote Added: 0026580
2010-05-03 17:00sureshbabuNote Added: 0026878
2010-05-03 17:00sureshbabuStatusresolved => closed
2010-05-04 00:00anonymoussf_bug_id0 => 2996190
2010-05-14 15:27hudsonbotCheckin
2010-05-14 15:27hudsonbotNote Added: 0027265
2010-05-18 12:12gorka_gilTarget Version2.50MP15 => 2.50MP17
2010-06-14 16:04adrianromeroRelationship addedrelated to 0013636

Notes
(0024723)
networkb   
2010-02-23 09:19   
Pending feedback from NPE
(0024796)
networkb   
2010-02-24 18:06   
When posting, only Account Schema is taken into account, so it does not make sense to define diferent combinations with same Accounting schema and diferent organization.

It should be avoided.
(0024809)
adrianromero   
2010-02-25 10:49   
The solution in this case is to add the same constraint of the table c_bp_customer_acct in the table c_bp_category.
(0025957)
adrianromero   
2010-04-07 18:23   
The previous proposed solution is not correct

The problem is that it is possible to define same configuration (Acct Schema + Status) for * and other Organization. But this should not be possible because of the constraint c_bp_customer_acct_bpartner_un .

It should be reviewed why this constraint does not work as expected.
(0026189)
dmitry_mezentsev   
2010-04-14 15:43   
Adrian,

Could you please in-line with this issue have a look at the 11526?
It is marked as Closed but I failed to complete this flow. In my case only one accounting configuration was created for a BP which has several accounting records in BP Category.
I would like this issue to be checked course fix of current one does not make sense without 11526.

Thanks.
(0026554)
hgbot   
2010-04-22 06:22   
Repository: erp/devel/pi
Changeset: ff1c64d7f68b5d987c47baa8f0e67f173ce5bcd4
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Thu Apr 22 10:07:14 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ff1c64d7f68b5d987c47baa8f0e67f173ce5bcd4 [^]

Fixes Issue 12225: Error when copying accounting configuration from BP group.

---
M src-db/database/model/triggers/C_BPARTNER_TRG.xml
---
(0026557)
harikrishnan   
2010-04-22 06:43   
Steps to test:

*Follow the steps to reproduce of these issues 11526,12588.

Reason for the fix

*A condition is added to avoid the insert of similar data where their is constraint in these 2 tables.
(0026562)
dmitry_mezentsev   
2010-04-22 11:25   
Hari,

Above in the protocol I asked to review previous issue - 11526. I followed the steps described in it in live.builds postgresql and the result was not coping 2 Accounting configurations I created to BP.
You can have a look at Vendor BP Category there and BP - DM Category Test.


Thanks.
(0026567)
adrianromero   
2010-04-22 12:01   
The problem here is that the fix for issue 12588 reverted the changes reverted the fix done in 1152. But now with the fix provided by Hari all issues related should be fixed.

Hari, could you confirm that?

(0026568)
dmitry_mezentsev   
2010-04-22 12:11   
Thanks, Adrian. We had a chat with Hari and he confirmed that.
(0026580)
dmitry_mezentsev   
2010-04-22 16:15   
My tests went well. Thanks.
(0026878)
sureshbabu   
2010-05-03 17:00   
Tested, working fine
(0027265)
hudsonbot   
2010-05-14 15:27   
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/ff1c64d7f68b [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/36f76c8d7193 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17198.obx [^]