Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022020Openbravo ERPA. Platformpublic2012-10-22 08:582012-10-30 08:47
guilleaer 
AugustoMauch 
normalmajoralways
closedfixed 
5
 
3.0MP17 
alostale
Core
No
0022020: AD_ORG validation fails when a table has 2 columns which are foreign key of ad_org_id
If I have a table with the traditional column ad_org_id and I add new one which points to ad_org_id the validation fails:

Errors for Validation type: INCORRECT_CLIENT_ORG_PROPERTY_NAME
+++++++++++++++++++++++++++++++++++++++++++++++++++
Table AD_Org has a column referencing AD_Org. The AD_Column.name (note: different from AD_Column.columnname!) of this column should have the value organization, it currently has obretcoDbpOrgid
Using postgresql admin:
1. add a column to ad_org -> obretcoDbpOrgid
2. add a foreign key constraint for this column. This column should be foreign key of ad_org.ad_org_id

In ERP:
1. Go to toables and columns
2. in table organization -> create columns from database

ant export.database

The following error should be shown

Errors for Validation type: INCORRECT_CLIENT_ORG_PROPERTY_NAME
+++++++++++++++++++++++++++++++++++++++++++++++++++
Table AD_Org has a column referencing AD_Org. The AD_Column.name (note: different from AD_Column.columnname!) of this column should have the value organization, it currently has obretcoDbpOrgid
No tags attached.
Issue History
2012-10-22 08:58guilleaerNew Issue
2012-10-22 08:58guilleaerAssigned To => AugustoMauch
2012-10-22 08:58guilleaerModules => Core
2012-10-22 13:00hgbotCheckin
2012-10-22 13:00hgbotNote Added: 0053506
2012-10-22 13:00hgbotStatusnew => resolved
2012-10-22 13:00hgbotResolutionopen => fixed
2012-10-22 13:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/34fd0be1e4c4a07a6dae0e98a94bee4acf5e7600 [^]
2012-10-22 13:08guilleaerNote Added: 0053507
2012-10-25 12:38hudsonbotCheckin
2012-10-25 12:38hudsonbotNote Added: 0053697
2012-10-30 08:47alostaleReview Assigned To => alostale
2012-10-30 08:47alostaleNote Added: 0053780
2012-10-30 08:47alostaleStatusresolved => closed
2012-10-30 08:47alostaleFixed in Version => 3.0MP17

Notes
(0053506)
hgbot   
2012-10-22 13:00   
Repository: erp/devel/pi
Changeset: 34fd0be1e4c4a07a6dae0e98a94bee4acf5e7600
Author: Guillermo Álvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Mon Oct 22 12:59:10 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/34fd0be1e4c4a07a6dae0e98a94bee4acf5e7600 [^]

fixed issue 22020: organization table doesn't need this validation

---
M src/org/openbravo/service/system/DatabaseValidator.java
---
(0053507)
guilleaer   
2012-10-22 13:08   
The validation was working fine, but an error is happening only with the organization table.

The table organization doesn't have any foreing key to the table ad_org. Because of that the validator is complaining when detects a column pointing to ad_column. Following general rules of openbravo this new column must be called organization but in case of table organization is not required.

Test plan:
add a column to the table ad_org which is FK of ad_org_id and the try to export database.

The error should't be shown
(0053697)
hudsonbot   
2012-10-25 12:38   
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/4a27e27689bc [^]

Maturity status: Test
(0053780)
alostale   
2012-10-30 08:47   
Code reviewed and tested in retail on pi@b2e90dcc4dc7