Archive

Posts Tagged ‘XML-RPC’

Loading data in OpenERP with XML-RPC Web services

Architectural elements involved in the XML-RPC.

Image via Wikipedia

Loading data from an external source into OpenERP is quite straight-forward. Before trying ETL tools (such as Talend and Kettle), you should try two things first. Understand OpenERP’s object model (you can do it in the customization menu or by reading the code), and then try it with Python.

Trying the data load with Python is quite easy. First, open the Python prompt. Then try an example, the best example is OpenERP’s XML-RPC Web services documentation itself. I mean, start your openerp-server, then line by line try the example. You will see how it works and how easy it is to load data with web services. Then, I would suggest reading the CSV Python module documentation, which explains how to read a CSV file. After that, you only need to put the pieces together, create a Python program that reads the information from a CSV file (which was exported from LibreOffice) and then l0ad that data into OpenERP with web services.

Cheers,

Advertisements

First steps with OpenERP in Argentina

December 13, 2010 Leave a comment
A screenshot of the GTK client of OpenERP 5.0....

Image via Wikipedia

The past week I installed and configured an ERP system for a client in Argentina. This client is analyzing and testing this system in order to implement it later. The ERP system is OpenERP, formerly known as TinyERP. This system was developed by OpenERP S.A. and is licensed under the AGPL license. If you would like to get more information on the business model for this company, you can check it out at its website. Enough with the presentation, let’s jump to the system installation.

OpenERP is already available in the Debian and Ubuntu repositories. You can find it at the unstable version of Debian. Ubuntu already has it in its packages. If your server is Debian or Ubuntu, you can do an

$ apt-get install openerp-server

in order to install it. Otherwise I recommend downloading and installing the server from the source code.

To the best of my knowledge this tool needs Python-2.5 or Python 2.6 (I tried both versions, the first one on a Debian server and the latter on an Ubuntu server) and the PostgreSQL database. Once the server is installed, you have to prepare the database. This is done by creating a postgresql user and creating a database. This is necessary, otherwise Postgresql users will not be able to connect to the system.

After installing the server, you need to install a client to use the system. OpenERP has two clients: openerp-client, which is based on GTK and openerp-web which is based on HTML. Both connect through Socket and XML-RPC to the openerp-server. The first client can be downloaded from the Debian/Ubuntu repositories with the following command:

$ apt-get install openerp-client

whereas the web client can be installed with easy_install (these are the instructions for configuring and installing it http://doc.openerp.com/install/linux/web/index.html)

After installing the client, you have to configure the system tables and the system itself. You can do that with both clients in the “Create Database option”.

The most confusing part in the installation procedure is how to configure Postgresql. To make the story short, we ended up with five users:

  • the Linux admin user
  • the Postgresql admin user
  • the openerp admin user
  • the openerp database user
  • and the openerp user itself

Keep in mind that the postgresql and the openerp database user do not require password! That is the default configuration.

After configuring the database, you need to install the local modules for your country (in this case, Argentina). I did so by installing the argentina modules which can be found at Launchpad. In order to install these modules, you have to install the launchpad tools. We install them first and then we download the argentinian localization mdoule

$ sudo aptitude install bzr

$ bzr branch lp:openerp-argentina

This last step downloads these modules to the current directory. You should copy them to the modules directory in your openerp installation and enable them. But I will cover this in a later post.

Cheers!