Archive for the ‘Human Resources’ Category

HR Attendance analysis with OpenERP

March 27, 2011 2 comments
KDE 4.0

Image via Wikipedia

My partner, Cristian Sebastian Rocha, has been working the past three months in the development of the hr_attendance_analysis module, which, as its name suggests, helps companies analyze their employees attendance.

This module allows you make calculations on the worked hours by employees. You can apply formulas and calculation rules in order to automate attendance calculation. It can also be integrated with other HR related modules, such as the clock_reader module.

This module also has a workflow for confirming the entered date on each document type, journal and payroll. The first document holds daily attendance information for the employee, whereas payroll holds payroll information on a monthly, bi-weekly or daily basis.

These are some screenshots for the module:

In this image you can see the main menu for accessing the HR module. You can also see the menu items for accessing the Payroll documents (selected) and Attendance Journals.

In this image you can see the document with the summary of employee hours (filtered by a date range). You can leave notes for each employee or for the document. It can have two states: draft and validated. We still have to develop the workflow for cancelling and re-setting the document.

In this screenshot we can see the entry for the employee Journal. Here you can see in detail the in and out time for a given date. You can also see the vacations or time off hours (such as late arrivals, early departures, sick days, etc.) To the left you can also see the result of the hours calculation.

This is a formula for summarizing the values stored in the journal, in order to be shown in the Payroll document.

This is a formula for calculating normal hours in a given  date for a given employee:

In this screenshot, you can see a rule. This rule assigns reasons for the actions of entering or leaving the plant. IN this case we can see how to calculate an early leave without a warning.

We still have things to do, but soon we will upload the module to LaunchPad. If you have any comments, or suggestions, they are more than welcome.



First steps in OpenERP 6.0. Creating and configuring the company

Polish OpenERP screenshot

Image via Wikipedia

The best way to know OpenERP is to try it. Developing a proof of concept. That is how you will get to know what are the possibilities of this system, what it takes to configure it, get a good grasp on the community and the time it takes to implement it. You can do it alone or guided with a consultant. Both ways work, a consultant will save you a lot of time.

So, how do you start? Well, the first step is to install it and have it running. I will not go into the details on how to install it, I can only recommend buying a VPS Linux server (there are two or three which have are excellent and are affordable). Then you can follow the detailed steps on how to install OpenERP on the documentation pages.

What I am going to talk about now is what you should do first in order to know the system. This is covered in the OpenERP book in the First Steps in OpenERP. You should read it (I encourage you to buy the book since it is an excellent read and for $40 it will save you lots of hours). The idea is to configure a system that buys products from suppliers (and pays them), manages the stocks of those products and sells those products to customers (while collecting their payments). Pretty much what every other company in this world does in order to make a living.

What should we do first? Well, I assume you already have OpenERP up and running. So we are going to set up the company. You do this by selecting the Administration > Configuration > Companies menu (in OpenERP 6.0):

Click on Companies and you will see the list of the companies already configured in your system. Click on the New Button to create a new one. You will see a form like this:

This form has a header and six tabs. On the header you only need to enter the Company name. Then in the General Information tab you should be able to enter the main currency for the company (more on this in later posts), header and footer information and the company logo (which will be printed in the many forms that are used by OpenERP).

You have two more tabs for customizing the Header and footer, along with its internals. We will not get into those items at this time. If you go to the Configuration tab you should be able to configure some parameters for the system, such as the Timesheet range or the Reserve Profit/Loss account. But this is taken care of in more detail in the Parameters section of the system. Same with the Other tab.

Skip the Other and Overdue Payments tabs since they are not necessary to configure by now.

After you have configured the company, you can go to the next section, which is configuring account types. But we will go into that in a latter post.


Connecting fingerprint readers to OpenERP

January 6, 2011 4 comments

A client asked us to connect its fingerprint reader to the Human Resources module in OpenERP. In order to do that we just released the Beta version of a new module, which is named “clock_reader”. This module is able to connect to the fingerprint reader F5, which is distributed by Digito-Uno in Buenos Aires. We understand, but we have not tested it yet, it should be able to connect to the fingerprint reader G3T, commercialized by Asensio Sistemas in Rosario, Argentina.

The module is able to read more than one fingerprint reader, which can be connected from different sites in the company; or might have many readers in only one input, in case you need to have a backup device or need more throughput.

Well, below are some module screenshots (in spanish):

The module creates a new “clock” object that is listed under the option “Clock” in the Human Resources > Configuration menu.

This object has the following attributes; the clock name, the URI to the reader (more on that later), the model or driver, a location and whether it is active or not.

In order to read the fingerprint reader, you need to select the menu item “Clock read” in the Human Resources > Attendances menu item.

After selecting that option, you will see a confirmation dialog asking you to confirm the action. Once the fingerprint reader is read, you will see a window with the attendances captured and the errors that might have ocurred in the process.

This module was designed to handle more than one fingerprint reader model, but so far we were able to test it only with the F5 model. If you would like to add a new model, you have to develop a new python class with the following interface:

  • def __init__(self, uri): Allows you to construct the clock class. The URI is an string that describes the port the application is connecting to. For instance, as the reader allows you an UDP connection, the URI to use is udp://
  • def test(self): Checks the reader connection. Returns false if it is not possible. In the clock class we created for the F5 reader it is convenient to set a timeout value, to avoid an infinite loop. We are using a 3 second timeout value.
  • def connect(self): Readies the class for the operations to follow. It can also return device information. For instance, the firmware version number.
  • def attendance(self): iterative function which in every iteration returns information on the reader ID, time and whether the record belongs to someone entering the premises or not. It might also return the input method, such as reader, card or keyboard.
  • def clean(self): erases the records stored in the reader.
  • def disconnect(self): disconnects from the reader.

With a class that complies with this interface, the capture system will capture every active reader and will add the attendances to the hr_attendance module in OpenERP.

Regarding the reverse-engineering needed to develop more fingerprint readers, you can look at two python programs at the test directory in the module.

The first file,, has a function for reading the captures made with Wireshark or any other program that exports the captured information in XML PDML (readpackets). It also has functions for checking that the conection is not encrypted (plothistogram) and for searching patterns (dotplot and align).

The second file,, is a virtual clock that takes a capture (there are three examples in the data directory) and listens so the client you are programming can connect to and query it.

You can find the module at Launchpad: