View source | View content page | Page history | Printable version   

Projects:Validity dates - Valid To/Technical Document

This project will be released as a new module available at


Module definition (development related parts)

Application Dictionary Changes

A new column called "EM_VALIDTO_VALIDTO" will be created in the following tables:

It's very important to ensure the column name for this columns defined at the Application Dictionary is equal to [EM_ValidTo_ValidTo] (capital letters are important). This ensures the three generated attributes (and getters methods) for each class have exactly the same name. This is mandatory for allowing us the use of reflection for simplifying the code development and for allowing future extensions (or new modules based on this one).


A new Dataset Client/Org data level will be created to store the definition of the Accounting process that checks the valid to value of the Business Partner, Element Value and Tax Rate entities.

Java Code


Represents the accounting process that checks the

* Business Partner
* Tax Rate
* Element Value (Account)

have a valid to field >= Document's Accounting date


Data Access Object used by the ValidToProcess class to access the database using DAL (Hibernate)


Utility class.

The public static boolean hasValidDateTo(final BaseOBObject baseOBObject, final String methodName,final Date date) method is very important because it verifies the baseOBObject has a valid to date >= date. The valid to date field can be defined with a different name for each BaseOBObject, so the methodName parameter represents the baseOBObject method to determine the valid to value.

Note: This method uses reflection for invoking the methodName passed as parameter, so it can be easily used in the future to define new processes that check the valid to field of any Openbravo BaseOBObject, like for example Organization, Accounting Schemas, etc.

Retrieved from ""

This page has been accessed 1,123 times. This page was last modified on 8 June 2012, at 05:31. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.