Archive for the ‘Fingerprint reader’ 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.



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: