Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013691Openbravo ERP02. Master data managementpublic2010-06-17 20:382012-05-25 12:12
dmitry_mezentsev 
mirurita 
normalminoralways
closedfixed 
5
2.50MP18 
3.0MP12 
Core
No
0013691: The same pair of Accounting schema and Status can be used several times in the Accounting tab of BP and BP Category windows
The same pair of Accounting schema and Status can be used several times in the Accounting tab of BP and BP Category windows if the Status field is empty.
http://live.builds.openbravo.com/erp_devel_main-full-pgsql/security/Menu.html [^]

Master Data Management > Business Partner Setup > Business Partner Category.
Select any existing one.
Go to Accounting tab.
Create a new record for Smallbazaar accounting schema and Status field empty.

Save it and check that now 2 lines with the same Accounting schema and Status exist.
This scenario works in Oracle.

It looks like Constraint defined for the BP and BP Category Acc tables does not work properly with Null values in Postgresql.

Proposed solution could be to remove Empty (Null) Status course there is an assumption that it works the same way as “--” Status.

Also it is good to have a check through the application to catch similar not working Constraints.
OB3-Reviewed, VMA-Reviewed
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 
related to defect 0020350 closed mirurita Multiple API Changes in Accounting Tabs 
Issue History
2010-06-17 20:38dmitry_mezentsevNew Issue
2010-06-17 20:38dmitry_mezentsevAssigned To => adrianromero
2010-06-17 20:38dmitry_mezentsevRelationship addedrelated to 0013636
2011-06-03 10:59dalsasuaAssigned Toadrianromero => dalsasua
2011-06-03 19:31dmitry_mezentsevNote Added: 0038007
2011-07-20 18:09dalsasuaAssigned Todalsasua => jonalegriaesarte
2011-10-28 20:15iciordiaTag Attached: OB3-Reviewed
2012-02-15 19:04iciordiaAssigned Tojonalegriaesarte => vmromanos
2012-02-16 17:12vmromanosTag Attached: VMA-Reviewed
2012-04-23 12:24vmromanosStatusnew => scheduled
2012-04-23 12:24vmromanosNote Added: 0047875
2012-04-23 12:24vmromanosfix_in_branch => pi
2012-04-23 12:37vmromanosNote Edited: 0047875bug_revision_view_page.php?bugnote_id=0047875#r3386
2012-04-23 12:37vmromanosNote Edited: 0047875bug_revision_view_page.php?bugnote_id=0047875#r3387
2012-04-23 13:26vmromanosNote Added: 0047876
2012-04-24 17:40vmromanosNote Added: 0047929
2012-04-25 16:18vmromanosRelationship addedrelated to 0020350
2012-05-10 12:12gorka_gilAssigned Tovmromanos => mirurita
2012-05-15 18:54hgbotCheckin
2012-05-15 18:54hgbotNote Added: 0048665
2012-05-15 18:54hgbotStatusscheduled => resolved
2012-05-15 18:54hgbotResolutionopen => fixed
2012-05-15 18:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/60b35ed88b247118da855997ec94e3833d00bb18 [^]
2012-05-15 19:00hgbotCheckin
2012-05-15 19:00hgbotNote Added: 0048666
2012-05-21 10:03miruritaNote Added: 0048793
2012-05-21 10:03miruritaStatusresolved => closed
2012-05-21 10:03miruritaFixed in Version => 3.0MP12
2012-05-22 09:30hgbotCheckin
2012-05-22 09:30hgbotNote Added: 0048843
2012-05-25 12:12hudsonbotCheckin
2012-05-25 12:12hudsonbotNote Added: 0049140

Notes
(0038007)
dmitry_mezentsev   
2011-06-03 19:31   
Status field is no longer used in 3.0 but still it is possible to create several rows with the same Accounting Schema.
(0047875)
vmromanos   
2012-04-23 12:24   
(edited on: 2012-04-23 12:37)
Unique constraint must be defined in the following table C_BP_GROUP_ACCT

C_BP_CUSTOMER_ACCT and C_BP_VENDOR_ACCT unique contraints are not working fine. NULL value in status column makes unique constraint to fail.
We should remove STATUS column from the unique constraints.

The following tables have defined the right unique constraint:
C_TAX_ACCT
M_PRODUCT_ACCT
M_PRODUCT_CATEGORY_ACCT
C_BP_EMPLOYEE_ACCT
C_GLITEM_ACCT
C_CHARGE_ACCT
FIN_FINANCIAL_ACCOUNT_ACCT
A_ASSET_GROUP_ACCT
M_WAREHOUSE_ACCT
A_ASSET_ACCT
C_PROJECT_ACCT

(0047876)
vmromanos   
2012-04-23 13:26   
The fix for this issue will create an API change.

Test plan I:
1. Go to Business Partner Category
2. Select any record
3. Go to Accounting tab
4. Try to enter two records for the same accounting schema
5. When you try to save the second one, an error message is displayed and the record can't be saved

Test plan II:
1. Go to Business Partner window
2. Select "Alimentos y supermercados". Go to customer tab
3. Go to Customer Accounting tab
4. Try to enter two records for the same accounting schema
5. When you try to save the second one, an error message is displayed and the record can't be saved

Test plan III:
1. Go to Business Partner window
2. Select "Bebidas alegres". Go to vendor tab
3. Go to Vendor Accounting tab
4. Try to enter two records for the same accounting schema
5. When you try to save the second one, an error message is displayed and the record can't be saved
(0047929)
vmromanos   
2012-04-24 17:40   
A build validation must be created to force the user to delete the wrong records before updating to the new version
(0048665)
hgbot   
2012-05-15 18:54   
Repository: erp/devel/pi
Changeset: 60b35ed88b247118da855997ec94e3833d00bb18
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Mon Apr 23 13:30:54 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/60b35ed88b247118da855997ec94e3833d00bb18 [^]

Fixed bug 13691: Acct. schema unique constraint in several tables
Created new unique constraint in C_BP_GROUP_ACCT (C_ACCTSCHEMA_ID, C_BP_GROUP_ID)
and added new error message.

Removed status from unique constraints in C_BP_CUSTOMER_ACCT and
C_BP_VENDOR_ACCT tables
Updated error messages beloging to these constraints

---
M src-db/database/model/tables/C_BP_CUSTOMER_ACCT.xml
M src-db/database/model/tables/C_BP_GROUP_ACCT.xml
M src-db/database/model/tables/C_BP_VENDOR_ACCT.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0048666)
hgbot   
2012-05-15 19:00   
Repository: erp/devel/api-checks
Changeset: ce0b7bcbb9f62a3f9ce25407ffdbd44b28f80726
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Tue May 15 18:59:32 2012 +0200
URL: http://code.openbravo.com/erp/devel/api-checks/rev/ce0b7bcbb9f62a3f9ce25407ffdbd44b28f80726 [^]

Related to issue 13691: api change add/modify unique constraints

---
M model/src-db/database/model/tables/C_BP_CUSTOMER_ACCT.xml
M model/src-db/database/model/tables/C_BP_GROUP_ACCT.xml
M model/src-db/database/model/tables/C_BP_VENDOR_ACCT.xml
M model/src-db/database/sourcedata/AD_MESSAGE.xml
---
(0048793)
mirurita   
2012-05-21 10:03   
code review + testing OK
(0048843)
hgbot   
2012-05-22 09:30   
Repository: erp/devel/api-checks
Changeset: 7224c70fafd8748bee89e9c956113d3b43bb7ac2
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Tue May 15 18:59:32 2012 +0200
URL: http://code.openbravo.com/erp/devel/api-checks/rev/7224c70fafd8748bee89e9c956113d3b43bb7ac2 [^]

Related to issue 13691: api change add/modify unique constraints

---
M model/src-db/database/model/tables/C_BP_CUSTOMER_ACCT.xml
M model/src-db/database/model/tables/C_BP_GROUP_ACCT.xml
M model/src-db/database/model/tables/C_BP_VENDOR_ACCT.xml
M model/src-db/database/sourcedata/AD_MESSAGE.xml
---
(0049140)
hudsonbot   
2012-05-25 12:12   
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/5401e185a8b0 [^]

Maturity status: Test