Skip to main content

Posts

Showing posts from June, 2010

Validations in Openbravo

Validations in openbravo are meant to ease the user's interaction with the system. The most simple example would be, there are two tables c_country and c_region provided in the core module. Now at run time when an user chooses a country he would want the regions of that particular country to be displayed. this is achieved by validations. Validations can be applied to four basic data-types in openbravo.  They are Button, List, TableDir and the Table. Now to add a validation go the validation menu in the Application Dictionary-->Setup. Provide a new name under your module and add your logic in the Validation code column. There are 3 types of validations possible viz, SQL,Java and JavaScript. Lets do the SQL type. now to validate the region all you got to add is "c_region.c_country_id=@c_country_id@" . Now add this in column "c_region_id" in any table that you have used. Now for further insight, the "@" symbol is used to fetch the value of the variab…

Display Logic and read only logic In Openbravo

Using display logic in Openbravo is a primitive task but might seem a lot more difficult until you get hold of it...The display logic can be applied at the window-field level. Lets see a example. We have two fields married which is a check box and children which is a text box. Now at runtime we wish to display the children text box only if the married is ticked. So to apply this Logic we need to write a display condition in the children field. The logic is very simple. just type @married@='Y' in the display logic column of the field children.Now for read only logic, if you want the children field to be defaulted to 0 instead of hiding it, we need to do it at the table-column level. In the children column type@married@='Y' in the read only logic field and set the default value field as 0.

Openbravo 2.50 shortcuts

hi all,
       I have been working with Openbravo for quite a while and with fairness to all the other ERP's, Openbravo is a good look and feel providing ERP. I used "good look and feel" instead of "good user interface" because User interface is the ease with which the customers acquaint themselves with the application. In that sense the last that a guy who is recording a sales order would want is the mouse. Its such a world that every little second delay could rob you off a customer. With a feature rich application like Openbravo lots of navigations is required. Though the developers dont feel the delay, the customers are robbed off quite a few vital seconds. This is where the shortcuts come into place. well...not all are required for all, some meant at developers alone and others at the customer alone, but may be getting used to the basic ones will save a lot of dwell time for both.

– CTRL+M - move the focus to the menu
– CTRL+Shift+M - expand or collapse t…

Working with postgres and tomcat in ubuntu

well to people who have been through ubuntu, executing applications in ubuntu via terminal might sound easy but its not the same case for the windows users. so considering the tomcat and postges are there in your system, lets see how to execute them.
1. postgres: postgres by default resides in the port 5432 and unless and until you have modified that, the command remains the same everywhere. so open the terminal and use the following command
sudo /etc/init.d/postgresql-8.4 start
note: the version 8.4 might not be the version that you installed. so use the version number. and first try without giving sudo. if an error "permission denied" comes up, then use sudo. sodu command is to upgrade yourself to the root user or admin for that operation alone. for stopping postgres just replace start with stop.

2. tomcat: for tomcat, usually the  folder reside in the usr/local folder if u install through the synoptic package manager, but i usually download the source from tomcat and the…

Why Ubuntu rather than Windows

Ubuntu Lucid is one of my new ultimate operating system choice and trust me it is not for the faint of heart. Though I have not left Windows completely (I usually have to switch to it to play games and do some work) but after much determination and struggle I have managed to adapt myself in the Linux environment and it is very cool and challenging.
        For those of you who think that Linux is terrible and Windows rocks, here is my say on why Ubuntu is better than Windows.
No Viruses - Thats true! as Linux does not recognize Win32 Executables so the possibility of having a virus on-board is absolutely 0%. THIS IS NOT 100% true. but its security mechanism is much better than windows.                                                                                                                                       Open Source - Unlike Windows, Linux distributions are open source and the source code can be edited and modified to the most to suit your needs.Better Learning - While Wi…

UBUNTU BASIC COMMANDS

UBUNTU BASIC COMMANDS:

1. echoing data:
        syntax: echo name(variable).
            returns the value of the variable

2. help:
        syntax: man command
            this will give us the syntax and options available in UNIX.

3. searching a particular file:
        syntax: find -name "tools.jar" print 2>/dev/null
            searches for the file "tools.jar" based upon the name and if not found returns error msg 2 and so we redirect it using ">" to the /dev/null directory.

4. pipe symbol:
        syntax: process1 | process 2
            the pipe symbol "|" is used to provide the output of one process as the input to the other process
            eg. ls -l | wc : here 'ls -l' returns the list of files within the directory and we provide this as the input to the second process 'wc' (wordcount). thus returning the word count of the list of files .

5. tee:
        syntax: tee option filename 
                 read from …

Openbravo ERP 2.50 customized installation in Ubuntu

hi all, i ve already put up a post on Openbravo ERP installation using the default repository method provided by Openbravo. But in some cases v need, to custom install those open source technologies like tomcat, ant, java etc to suit our needs. So i have presented a simple set of steps required to sun Openbravo in UBUNTU. (disclaimer:even this information is provided in openbravo wiki but in lot more elaborated form...:))

Openbravo complete installation in UBUNTU 9.10

Environment:
A. postgres 8.4

B. java 6

C. tomcat 6

D. Apache ant (build tasks)

E. openbravo source (2.5MP9)



A. Postgres:
1. Installing postgres:

sudo apt-get install postgresql-8.4 postgresql-contrib-8.4

2. Setting username

sudo -u postgres psql

alter role postgres with password 'postgres';

\q



B. Java:
1. Run the following steps

sudo apt-get install sun-java6-jdk

sudo update-java-alternatives -s java-6-sun

echo 'JAVA_HOME="/usr/lib/jvm/java-6-sun"' | sudo tee -a /etc/environment

source /etc/e…

ATTITUDE

Well i was having a hot shower in the morning(all showers are hot whether its morning or night in Chennai though) and i was thinking about what some George F.Burns said, " i honestly think its better to be a failure at something you love than to be a success at something you hate...". I have this quote written in my wall above my PC and my family often gives a wry smile seeing it. I wonder whether they understand it. geek...they do and so only they manage a smile. I was thinking why people never do what they like. What could happen at the max? they would be utter failure, they would be damned by all. People would laugh at them, they would starve to complete their life. Seems a bit bad fortune isn't it. but common, why do u ever care about people smiling sarcastically at you? they smile at everyone. They mock you but deep inside i can assure you that they ll see you as a hero who lived his own life. Its their ego that doesn't let them accept that they are failures who…

Openbravo ERP 2.50 installation steps in ubuntu (default installation)

Hi all, there are n number of ways presented in openbravo community to try or work with Openbravo ERP. but i felt any of them were too big for novices. So i ve presented my small complition (CCP:Cut,Copy,Paste) version of installing Openbravo in Ubuntu. There is a virtual box appliance that is far more easier to install than this. but lemme get to its disadvantages in a later post.


1. Adding canonical partner repositories. (this is not present by default)
$ sudo gedit /etc/apt/sources.list

2. In the file that opens up add the following lines,
deb http://archive.canonical.com/ubuntu karmic partner
deb-src http://archive.canonical.com/ubuntu karmic partner

3. Installing the application
$ sudo apt-get update
$ sudo apt-get install openbravo-erp

4. This will install openbravo cluster,apache tomcat,postgres. Openbravo uses its own properties so the post numbers are not the default ones.

5. To run the application, type the follwing in the browser menu.
ht…

Renewed installing openbravo in eclipse manual

hi all,
Openbravo is a collection of various opensource tools and modifying and maintaining all the code is a tough task. This is where the need for an IDE like eclipse, netbeans comes into the picture. openbravo wiki has detailed explanation of how to install openbravo in eclipse. But that was lot vague and unupdated.. They have sat and completed the reworking and presented a new document for easy installation.
this is the link for eclipse installation
http://wiki.openbravo.com/wiki/ERP/2.50/Developers_Guide/Development_Environment/Setting_up_Development_Environment_with_Eclipse_IDE

and this is the link for netbeans installation( which is what i use because eclipse in ubuntu has its own bugs and pitfalls)
http://wiki.openbravo.com/wiki/ERP/2.50/Developers_Guide/Installation_and_setup_of_Netbeans_IDE

Naming conventions for Tables in Openbravo

1. The Name of the Document shoould be in camel case and also should begin with the module's prefix and should not include blank spaces (REST web services cannot be created) .
Eg. The table c_orderline can be written as "C_OrderLine"

2. Description is a must and the name can be used if the description is unknown.

3. Better to inculde help/comments that will help for further reference.

4. The java table name should always be in lowercase. (since postgres is not case sensitive its better to use lower case)

5. The view option should be selected only for read only tables. These tables cannot be accessed through a web-service as POST methods will be invalid on those tables.

6. The java class name should also be camel cased.

7. Data access level should be set accordingly.
* System only: Only system records can be inserted into this table (AD_CLIENT_ID=0, AD_ORG_ID=0), for example AD_TABLE.
* System/Client: System or client specific records can be inserted here (AD_CLIENT_I…

Getting window and menu details from table name

hi all, 
            its quite a task in openbravo to find a table associated with a window and to find the window , tab and menu for a given table. I ve written a small function to provide the window name and menu names given a table name.




CREATE OR REPLACE FUNCTION get_details(tab_name character varying)   RETURNS void AS $BODY$ DECLARE window_id varchar(32); window_name varchar(100); menu_id varchar(32); tmp_men varchar(100); menu_name varchar(100)[]; par_id varchar(32); i numeric; j numeric; Menu varchar(250); BEGIN i:=0; j:=0; Menu:='Menu : Openbravo'; ---- get window corresponding to table Raise Notice '----------------------Table Details----------------------'; Raise Notice 'Table Name : %',tab_name; select a.ad_window_id,b.name into window_id,window_name  from ad_table a,ad_window b where a.tablename=tab_name and a.ad_window_id=b.ad_window_id; Raise Notice '----------------------Window Details----------------------'; Raise Notice 'Window Id Mapped : %',window_i…