ERP/2.50/API changes
Contents |
Openbravo ERP 2.50 - Core API changes
This document explains all changes happened in the public API of core module within 2.50 release. These changes are a potential risk of module breakage so all of them have been reviewed and explicitily approved. Every time a new change happen it will be included in this list and communicated as an alert through openbravo-development mailing list and Developers forum.
PI
MP11 (not released yet)
| ID | Type | Description | Risk | Comments |
| 11.1 | Removed process | ChangeAudit process removed from AD | None | There's a Servlet that is called to change the audit status (show/not show) for a tab. This Servlet was defined as a process in AD, which means that to be able to operate it, it was necessary to explicitly grant access to the process. The solution for the bug consisted in removing it from processes in AD (which makes the API change) and creating it as a simple mapping. |
MP10
| ID | Type | Description | Risk | Comments |
| 10.1 | Modularity rules adjustments | Modularity rules adjustments | Low | Here is a complete explanation of the changes. There are 2 API changes:
|
MP9
| ID | Type | Description | Risk | Comments |
| 9.4 | Changed Java type for reference Number | Changed Java type for reference Number | Very High | There has been a critical change in Openbravo 2.50 public API to be released in MP9 (November 30th, 2009). DAL implementation of columns referenced as Number in the Aplication Dictionary are mapped now to BigDecimal intead of Float. Getters and Setters for those columns are no longer using Float data type but BigDecimal. For more information, clic on this |
| 9.3 | Removed public methods | Removed public methods getModule() and setModule(String module) from class ExportDatabase | Low | The ExportDatabase had non-working methods to specify the Module you wanted to export. They never worked and caused confusion, so they have been removed. This shouldn't affect users that use the export.database task in a normal way, that is, by calling the ant task. The only way to get a problem is to directly instantiate the Task class as a Java class, something that should never be done. |
| 9.2 | Modified unique constraint | Modified C_PERIOD_UNIQUE_PERIOD unique constraint in C_Period table | Low | The C_PERIOD_UNIQUE_PERIOD unique constraint failed when a client created two calendars with the same start and end period days. Take into account that it is a very strange scenario in 2.50, because different organizations can share the same fiscal calendar, so there is no need to create to exact calendars.
In case your database is affected, the upgrade process will show an error when trying to set the C_PERIOD_UNIQUE_PERIOD constraint. Take into account that all your data will be kept and the upgrade process will not be stopped by this error. The Duplicated Period Alert module can be used to detect duplicated periods before upgrading the system. |
| 9.1 | Added DB Unique constraint | Added Unique constraint for MA_PROCESSPLAN.VALUE column | Low | Added a missing unique constraint to the column "Value". |
MP8
| ID | Type | Description | Risk | Comments |
| 8.3 | Changed width of a column in database | DocBaseType column in table Fact_Acct has changed its width from 3 to 40 characters. This way, modules will be able to create new DocBaseType elements, including the db prefix of the module. | Medium | 10939 issue raised because of this change introduced in the fix of the 10707 issue. |
| 8.2 | Missing java method | org.openbravo.erpCommon.obps.ActivationKey.getSubscribedModules(boolean)
org.openbravo.erpCommon.obps.ActivationKey.isModuleSubscribed(java.lang.String, boolean) | Low | These two methods have been modified to keep the commercial modules status. |
| 8.1 | Change column datatype | Fact_Acct.DocBaseType length change from CHAR(3) to NVARCHAR(40) | Low | The accounting process uses this column to store Document base types. Those have just three characters but when adding new ones from a module the DB prefix is mandatory so 3 characters are not enough. |
MP7
No API changes.
MP6
| ID | Type | Description | Risk | Comments |
| 6.4 | Missing java method | constructor org.openbravo.services.webservice.Module(java.lang.String, java.lang.String, org.openbravo.services.webservice.ModuleDependency[], java.lang.String, java.lang.String, org.openbravo.services.webservice.ModuleDependency[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String): missing
constructor org.openbravo.services.webservice.ModuleDependency(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String): missing constructor org.openbravo.services.webservice.SimpleModule(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String): missing method org.openbravo.services.webservice.ModuleDependency.getModuleVersionID(): missing method org.openbravo.services.webservice.ModuleDependency.setModuleVersionID(java.lang.String): missing | Low | Changed generated classes based on a WSDL definition Issue 10704 |
| 6.3 | Added DB check constraint | Added check constraint ('Y', 'N') for AD_Module.IsCommercial column | None | Added the missing constraint to ensure a boolean value Issue 0010546 |
| 6.2 | Change column datatype | AD_Heartbeat_Log.OS_Version length change from VARCHAR(20) to VARCHAR(100) | Low | The Heartbeat process cannot be enable in the virtual appliance because the OS version reported is too long. Usually a linux version reports something like 2.6.30-gentoo-r5, but the virtual appliance OS version is reporting 2.6.29.6-0.6.smp.gcc4.1.x86.i686, that is too long for storing it on a varchar(20) column. More information in the Issue 10603 |
| 6.1 | Unique constraint added on C_Period table | Added constraint for avoiding duplicated periods | Low | The C_PERIOD_UNIQUE_PERIOD unique constraint has been added to the C_Period table to control the duplication of accounting periods for the same client. This API break is due to the fix of the bug.
This change must just affect users who have duplicated periods in their database. In this case the upgrade process will show an error when trying to set the C_PERIOD_UNIQUE_PERIOD constraint. Take into account that all your data will be kept and the upgrade process will not be stopped by this error. The Duplicated Period Alert module can be used in order to help the user to determinate whether he already has duplicated periods before upgrading the system. |
MP5
No API changes.
MP4
| ID | Type | Description | Risk | Comments
|
| 4.3 | Unique constraint added on c_elementvalue table | Missing unique constraint on c_elementvalue table | High | The Unique constraint of VALUE and C_ELEMENT_ID was removed from C_ELEMENTVALUE.xml file by accidently while committing the new feature implementation of Defining the new sub-account per Business Partner and Product. we realized that this involuntary change happened, So It chances to have the duplicate records in the table of C_ELEMENTVALUE because there is no unique constraint between VALUE and C_ELEMENT_ID Column. The constraint removal was included in mp3 and constraint re-activation will be included in mp4 Actions taken:
SELECT COUNT(*),VALUE,C_ELEMENT_ID FROM C_ELEMENTVALUE GROUP BY VALUE,C_ELEMENT_ID HAVING COUNT(*)>1;</br>
|
| 4.2 | A column changes from nullable to not-nullable | C_ACCTSCHEMA_DEFAULT.CB_CASHTRANSFER_ACCT turns to not nullable column, and it's field to mandatory. | High | <p>This column was not nullable in 2.40, and some moment during 2.50 development, it turned to nullable. Due to the issue 10073, we realized that this involuntary change happened, and turned it again to not nullable.</p><p>This raises an issue, because this value corresponds to a default account in the accounting schema. Until now, an initial client/org setup could be done in 2.50 with a chart of accounts without this default value. In this case, in order to perform a successful update of core with this change, some value must be set in that column. Here there is no way of doing an automatic functionally valid action. User must choose the account suitable of being the default CB_CASHTRANSFER_ACCT.
</p><p>Actions taken:
<p>SQL snippets: SELECT CASE WHEN (SUM(A)>0) THEN 'DEFAULT NOT PRESENT!!' ELSE 'EVERYTHING IS OK!!' END AS A FROM (SELECT CASE WHEN (CB_CASHTRANSFER_ACCT IS NULL) THEN 1 ELSE 0 END AS A FROM C_ACCTSCHEMA_DEFAULT) SQL; </p><p>To locate those accounting schemes: SELECT S.NAME FROM C_ACCTSCHEMA S, C_ACCTSCHEMA_DEFAULT D WHERE S.C_ACCTSCHEMA_ID = D.C_ACCTSCHEMA_ID AND D.CB_CASHTRANSFER_ACCT IS NULL; </p><p>Action that will be done authomatically when updating, only for accountins schemas where CB_CASHTRANSFER_ACCT column is null: UPDATE C_ACCTSCHEMA_DEFAULT SET CB_CASHTRANSFER_ACCT=CB_ASSET_ACCT WHERE CB_CASHTRANSFER_ACCT IS NULL; </p> |
| 4.1 | Changed datatype for PL-function parameter | The datatype of the parameter p_referencevalue_id of the PL-function AD_DISPLAY_LIST has been changed from NUMERIC to VARCHAR | None | This change was mandatory to fix Issue 6713 . The content of this parameter is an id value which is an UUID in the 2.50 release, and without this change the function did not work with non-numeric only values for this parameters. Additionally without this change the function did not work even with numeric values on postgresql 8.3 because of the datatype mismatch. More info can be found in Issue 10008 . |
MP3
| ID | Type | Description | Risk | Comments |
| 3.3 | Changed columns definition | After this change, the amount columns of the C_TAXREGISTER and C_TAXREGISTERLINE tables have no length limitation and accept decimals | Low | This change was mandatory to fix Issue 9823 and it does not affect previous installations since the conversion from integer to decimal is automatic. Just take into account that this change can affect your Java developments if you're expecting to get an Integer from these database columns. |
| 3.2 | Added standard check constraint for the column IsActive that was missing | Check Constraint addition: table: AD_ORG_ACCTSCHEMA - Constraint: ADORGACCTSCH_ISACTIVE_CHECK | None | This change shouldn't affect any module since this field is a check box that should just have the values 'Y' or 'N'. More information in the Issue 9856 |
| 3.1 | Changed field from instance to static | org.openbravo.base.HttpBaseServlet.strDireccion field has been changed from instance field to static-. | None | This change shouldn't affect any module since this field can be accessed in the same way it was done before the changeset. More information in the Issue 9846 |
MP2
| ID | Type | Description | Risk | Comments |
| 2.12 | Changed method return type | method org.openbravo.model.ad.utility.AD_Attachment.getBindaryData(): type java.lang.Object instead of type byte[]
method org.openbravo.model.ad.utility.Image.getBindaryData(): type java.lang.Object instead of type byte[] | High | In 2..50 and 2.50mp1, BLOB column data types were not supported by DAL. For this reason, in the generated classes this kind of columns were mapped to a generic "Object" property. Now, DAL supports BLOBs, and thus they are mapped to byte[] properties. Currently, there are only two tables with BLOB columns in the Openbravo database (AD_Attachment and AD_Image). However, if a module adds BLOB columns, caution should be taken when using the corresponding DAL-generated class. |
| 2.11 | Added abstract methods | method org.openbravo.erpCommon.utility.GenericTree.getNodePosition(java.lang.String): new abstract method in 31
method org.openbravo.erpCommon.utility.GenericTree.getParent(java.lang.String): new abstract method in 31 method org.openbravo.erpCommon.utility.GenericTree.isLastLevelNode(java.lang.String): new abstract method in 31 | Low | These 3 methods were private in GenericTree class and they were specific for ModuleTree class. They are now abstract in order to allow trees for other elements than modules, therefore subclasses extending GenericTree must implement these methods. |
| 2.10 | Change column datatype | AD_Process_Request.OB_Context length change from VARCHAR(1000) to VARCHAR(4000) | Low | The OB_Context columns holds a json serialized version of the user context. Increased length to hold several organizations on the 'accessible organization tree'. More information in the Issue 8917 |
| 2.9 | Change Number of Arguments in Java Function | Some sql statements in ReportDebtPayment_data.xsql changed it's number of parameters. | Low | Needed to allow the new group by option in the report |
| 2.8 | Change Number of Arguments in Java Function | Some sql statements in ReportGeneralLedger_data.xsql changed it's number of parameters. | Low | Needed new parameters to make the report work with a big amount of entries in FACT_ACCT table. |
| 2.7 | Change reference (dataType) in AD_Column | Reference (datatype) of record in AD_Column for AD_HeartBeat_Log.code_revision column from numeric to String | Low | In the database this column is a varchar. This change is to align the definition in the Application Dictionary with the physical database schema. |
| 2.6 | Change column datatype | AD_System_Info.testproxy changed from CHAR(1) to VARCHAR(60) | Low | Is a button in the application. Was changed to handle different labels on it. |
| 2.5 | Message value changed | Changed column value AD_MESSAGE.VALUE -ID:1005500012 from [-20270] to [20270] | None | Previous value was not working |
| 2.4 | Message value changed | Changed column value AD_MESSAGE.VALUE -ID:1005500008 from [-20259] to [20259] | None | Previous value was not working |
| 2.3 | Message value changed | Changed column value AD_MESSAGE.VALUE -ID:1005500007 from [-20260] to [20260] | None | Previous value was not working |
| 2.2 | Change column length | AD_HeartBeat_Log.Proxy_Server column length changes from 20 to 100 | Low | Search for small pl/sql variables reading that column |
| 2.1 | Change column length | AD_System_Info.Proxy_Server column length changes from 20 to 100 | Low | Search for small pl/sql variables reading that column |
MP1
| ID | Type | Description | Risk | Comments |
| 1.8 | AD process removed | AD process (ID = 800193) has been removed from the application dictionary | None | This process (report in fact) was not implemented so it is not likely your module is using it |
| 1.7 | Column missing | C_INVOICE_CANDIDATE_V.totallines column has been removed | High | This view has been completely refactored. If you are using this view in your module you need to refactor your module as well |
| 1.6 | Change column datatype | I_Order.PaymentRule1 and I_Order.PaymentRule2 columns datatype change from CHAR(1) to VARCHAR(60) | Low | Check if you read those columns in small pl/sql variables. A list MUST be VARCHAR2 |
| 1.5 | Missing java field | The visibility of the field org.openbravo.erpCommon.ad_forms.DocOrder.m_taxes has changed from public to local | Low | Check if your module uses this field and if so remove that usage. Risk is low since it is a very internal field |
| 1.4 | Missing java field | The visibility of the field org.openbravo.erpCommon.ad_forms.DocAmortization.ACCTTYPE_Depreciation has changed from public to local | Low | Check if your module uses this field and if so remove that usage. Risk is low since it is a very internal field |
| 1.3 | Missing java method | org.openbravo.service.dataset.DataSetService.hasChangedCheck(org.openbravo.model.ad.utility.DataSet,
java.util.Date) has been renamed to org.openbravo.service.dataset.DataSetService.hasChanged(org.openbravo.model.ad.utility.DataSet, java.util.Date) | Low | Check if there are a call to this method in your module and if so rename it. Risk is low since it is a very internal method |
| 1.2 | missing java method | org.openbravo.dal.core.OBContext.restorePreviousAdminMode() has been replaced by org.openbravo.dal.core.OBContext.setInAdministratorMode(boolean) | Low | Check if there are a call to this method in your module and if so follow the approach as described here. Risk is low since it is a very internal method |
| 1.1 | change return type in java method | org.openbravo.dal.core.OBContext.setInAdministratorMode(boolean) returns a boolean, before it return nothing (void) | Low | Code change is not required, however the system needs to be rebuild because the method signature can be binary incompatible. See here for more information on how to use this method. Risk is low since it is a very internal method |

