Archive for January, 2012

Securing your system

Quick post of a script worth using. If your openerpserver is running on a Linux server, this server should be secured. Linux is a more secure server than Windows, but still is vulnerable to attacks. If you are new to the security field in Linux, there is a tool you should try, Bastille Unix. If you are using an

Ubuntu distribution, you can install this tool with the following command:

# sudo apt-get install bastille

After running the command bastille, you will see a wizard like window interface which will guide you through the different steps of hardening your system. These steps involve setting file permissions, disabling FTP, Firewall, Printing, disabling unnecesary services and accounts. Not only this is a very good tutorial on Linux security, but also a tool for hardening your system.

Be aware that your security obligations do not end here, this is just a very good first step.


How to debug your OpenERP modules

Debugging your OpenERP modules is quite straightforward, as long as you know basic Python programming. Just insert the following line in your

English: Python logo Deutsch: Python Logo

Image via Wikipedia


import pdb;pdb.set_trace()

Then restart your openerp-server with the —debug option

# openerp-server –debug

Then monitor your server console. You will see your server stop and show you a command line prompt where you will be able to debug your program.
You will find further information in the Python documentation website.

Calculating a product cost with OpenERP

Last week I had the opportunity to try a very useful module that, IMHO, should be included in OpenERP core. This module is product_extended and can be found in the extras repository, you can download it with the following command:

#  bzr branch lp:openobject-addons/extra-6.0

This module does many things, among them shows the product last order for a supplier and its date. But what is really interesting is that it calculates a product cost based on its Bill of Materiales. In order to do that, first you need to check the “Compute Standard Price” check box in the product form,

Then, you can either click on the “Compute Standard Price” button or check it in the product bill of materials (a product can have more than one bill of materials). In the latter, you can find the product information on the Bill of Materials form.

You can calculate the standard price by clicking on the “Compute Standard Price” wizard on the right of the BoM form. How is this cost calculated? This is the interesting part, it takes into account the product cost of each product, plus the hours and cycle costs of every workcenter that is involved in its routing. A very useful module.

It needs a minor change in order to make it work with OpenERP 6.1 but you should try it, I highly recommend it


Managing your openerp processes with Supervisor

Reading a book on system administration with Python I found Supervisor, which is a tool that allows you manage your programs. I found it easy to

English: A picture of a Dell PowerEdge 850 web...

Image via Wikipedia

install and learn, and in minutes I had it running in my system. After reading the documentation, which took me minutes, I was able to configure its configuration file, restart the daemon and have openerpserver and openerp-web running automatically in my computer.

Below is am example of how to modify the supervisord.conf file in order to start openerp-server and openerp-web



Why I like it? Because this tool allows me to manage my process and it does not take me long to do that. It can also be controlled by other Python programs, which might be handy in some projects.