Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020327Openbravo ERP00. Application dictionarypublic2012-04-23 13:112012-04-26 10:33
dmiguelez 
dmiguelez 
immediatemajoralways
closedfixed 
20Community Appliance
 
3.0MP12 
Core
No
0020327: API Change in FACT_ACCT.FACTACCTTYPE
Change:

The definition of FACT_ACCT.FACTACCTTYPE is as of today as yes/no reference in the AD and a char of 1 in the database. But this is wrong, and has generated some issues.
It should be defined as a list reference in the AD and as a varchar of 60 in the database.

Why the change is needed:

Right now through DAL, since it is a yes/no reference, only 'Y' or 'N' values can be inserted or retrieved. But it was expected that other values were possible to be inserted, so it has generated some issues that, in the end, can result in an incorrect accounting balance.

Possible risks:

Since the description of the database is going to change, we already know that some views that are retrieving information from this table must be changed. We also know that the module 'https://code.openbravo.com/erp/pmods/org.openbravo.acctTab/' [^] has plenty of views that must be changed.
All the modules that were using DAL to retrieve information will be affected too, but since it was not working properly to begin with, we assume that the risk taken is not that huge.
Login as Openbravo/openbravo
Change the rol to System Administrator.
Go to Tables and Columns.
Select the row with the DB Table Name: Fact_Acct
Go the Column Tab.
Select the row with the DB Table Name: FactAcctType
Realize that the Reference is defined as YesNo
Change the AD definition to a list reference.
Change the Database definition to varchar of 60.
Change the AD definition of the views that are affected and belong to core.
Raise an issue to change the AD definitions of the views present in the accounting tab module.
No tags attached.
related to defect 0011411 closed dmiguelez FacAcctType column of Fact_Acct table does not have a correct reference 
Issue History
2012-04-23 13:11dmiguelezNew Issue
2012-04-23 13:11dmiguelezAssigned To => iciordia
2012-04-23 13:11dmiguelezModules => Core
2012-04-23 13:11dmiguelezRelationship addedrelated to 0011411
2012-04-23 13:38iciordiaNote Added: 0047877
2012-04-25 09:45dmiguelezNote Added: 0047944
2012-04-25 09:45dmiguelezNote Edited: 0047944bug_revision_view_page.php?bugnote_id=0047944#r3399
2012-04-25 12:39iciordiaNote Added: 0047959
2012-04-25 12:40iciordiaAssigned Toiciordia => dmiguelez
2012-04-25 16:41dmiguelezStatusnew => acknowledged
2012-04-25 16:41dmiguelezStatusacknowledged => scheduled
2012-04-25 16:41dmiguelezfix_in_branch => pi
2012-04-25 18:11hgbotCheckin
2012-04-25 18:11hgbotNote Added: 0047972
2012-04-25 18:11hgbotStatusscheduled => resolved
2012-04-25 18:11hgbotResolutionopen => fixed
2012-04-25 18:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/api-checks/rev/e22cf4269bbf6d0344ed5d126a5e92e8160e3cc0 [^]
2012-04-26 08:58hgbotCheckin
2012-04-26 08:58hgbotNote Added: 0047986
2012-04-26 10:33miruritaNote Added: 0047992
2012-04-26 10:33miruritaStatusresolved => closed
2012-04-26 10:33miruritaFixed in Version => 3.0MP12

Notes
(0047877)
iciordia   
2012-04-23 13:38   
Before moving forward lets validate -querying the central repository- that there are no modules affected.

Ismael
(0047944)
dmiguelez   
2012-04-25 09:45   
We have done two more tests:

First we checked in some clients whether they have different values from what was expected inserted for this column in their database. They did not.

Secondly, we checked the Centra Repository to find if there was any module that uses DAL to call the previous method, because it would be affected and there would be problems compiling. But we found no one.

So we can say that this change won't break any module and it is unlikely to find a client with different data in their database.

(0047959)
iciordia   
2012-04-25 12:39   
Thanks for the double-check. Approved.

Ismael
(0047972)
hgbot   
2012-04-25 18:11   
Repository: erp/devel/api-checks
Changeset: e22cf4269bbf6d0344ed5d126a5e92e8160e3cc0
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Wed Apr 25 18:04:42 2012 +0200
URL: http://code.openbravo.com/erp/devel/api-checks/rev/e22cf4269bbf6d0344ed5d126a5e92e8160e3cc0 [^]

Fixes issue 20327: Changed a yes/no reference to a list reference.
Changed the length of the column in the database.
Changed related views.

---
M model/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml
M model/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml
M model/src-db/database/model/tables/FACT_ACCT.xml
M model/src-db/database/sourcedata/AD_COLUMN.xml
M model/src-db/database/sourcedata/AD_REFERENCE.xml
M model/src-db/database/sourcedata/AD_REF_LIST.xml
---
(0047986)
hgbot   
2012-04-26 08:58   
Repository: erp/devel/api-checks
Changeset: 14692b1b47602ca577d5437a16ffcedce878fd49
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Apr 26 08:58:02 2012 +0200
URL: http://code.openbravo.com/erp/devel/api-checks/rev/14692b1b47602ca577d5437a16ffcedce878fd49 [^]

Related to issue 20327: Changed generated java classes.

---
M java/reference/java.japi.gz
---
(0047992)
mirurita   
2012-04-26 10:33   
API build established

FactAcctType column is a List containing the following values
N: Normal
C: Close
R: Regularization
O: Open

Physical definition of the column has been changed to VARCHAR(60)