Efficient time tracking
Connection of an NFC card reader (time tracking terminal) to Odoo
23 November, 2023 by
Efficient time tracking
manaTec GmbH, Alexander Heyber
 


Introduction & problem definition:

At the latest since the recording of working hours of all employees of a company has been anchored in law, every employer must deal with the recording of working hours . Odoo offers a very efficient way of recording attendance times for each employee. A major advantage here is that this is mapped via the personnel module, which is already available in the Community version. This trick means that no user account is required, which in the Enterprise version means that more staff can record attendance times than there are users in Odoo. The Odoo time recording module is therefore cost-saving in both the Community and Enterprise versions, which makes the use of time recording in Odoo attractive.
Without a user account, however, logging in and out is only possible with additional technical effort. A set-up tablet with additional security is necessary, for example, to make the portal view of the recording available to every employee in a tamper-proof manner. Time is recorded by searching for the employee's avatar on the tablet in the portal view and logging in or out by entering a pin. Alternatively, a barcode can also be scanned, but this usually requires a tablet solution with an additional scanner.

Goal setting: 

The aim of manaTec was therefore to create a very efficient solution that can be used without a great deal of set-up work, which runs stably in daily operation and also enables fast recording at peak times. In addition to the barcode scanner, NFC (Near Field Communication) technology offers the fastest way to capture data. This is used, for example, for contactless payment by EC card. It quickly became clear that, in addition to speed, this technology also offers advantages in terms of security and subsequent management of the cards in Odoo. An NFC card reader that could be connected to Odoo therefore had to be found. However, after some research, disillusionment quickly set in, as there was no solution on the market for this (as of 2019). Therefore, manaTec decided to develop its own solution, which resulted in our time recording terminal manaTec Timetracking.

The conceptual structure provides for the entire intelligence and administration to be in Odoo. Although the terminal itself is complex, in the recording chain it only functions as a card reader with a transfer function to Odoo. This means that any number of terminals can be used to capture the NFC card and damaged terminals can be easily replaced at any time without losing or having to transfer data. Even theft of the terminal would not lead to any loss of data.

  • Compact design
  • Efficient and yet easy to read display option
  • Simple operability
  • Robustness in a harsher environment (can be used in a warehouse, for example)
  • Location-independent from a network connection

Since manaTec has experience in the field of embedded systems, it was obvious to create a solution for presence detection in Odoo using NFC. The choice of the core component, the controller, fell on theSince manaTec has experience in the field of embedded systems, it was obvious to create a solution for presence detection in Odoo using NFC. The choice of the core component, the controller, fell on the ESP32, as this not only offers uncomplicated programming but also an integrated WiFi module. In addition, due to its widespread use, there is a great deal of know-how in the community, which is freely available via various forums and websites. The high availability of solutions for connecting displays and NFC adapters, for example, leads to a short time-to-market, another advantage of the ESP32. A touch display is very well suited for simple operation and yet good visualization, our choice fell on the modular touch display ILI9341. Although this is actually the name of the SPI TFT driver, you will find the finished modular touch display under this name in almost all search results. A base board and a suitable housing are also already available: Our solution uses the Arduino Touch wall housing, which already includes the touch display. All that is missing now, apart from a power supply unit, is an NFC adapter. We opted for the RC522 as it can be embedded in the housing, resulting in a compact device. All the components mentioned can be connected without compromise using an additional 7-core cable. However, the assembly requires some experience in handling soldering irons and solder as well as cable assembly. However, due to the selected modular components, it is possible to work without a microscope, as no SMD components need to be installed.

The finished appliance is assembled in the following rough steps:

  1. Procurement of all necessary components
  2. Assembly of the 7-core connection cable
  3. Soldering the cable to the NFC reader and the base board
  4. Attaching the display
  5. Inserting the ESP32
  6. Attaching the NFC reader to the inside of the front panel
  7. Assembling the housing
Insight into the terminal hardware

Software component I - Firmware:

The much more complex part of the time recording terminals is the firmware, which is necessary for operation. The following main requirements must be met:

  • Update capability
  • Control of the color display
  • Reading and evaluating the touch feedback
  • Reading and evaluating NFC cards
  • Simple initial setup (integration into a WLAN structure)
  • Web interface for administration (host)
  • REST API (client) via https/JSON (integration via IoT functionality in Odoo)

The firmware was written by us in C, but components in HTML, CSS and JS are also used for the web user interface. For operation on the ESP32, the source code must be compiled and then installed on the ESP32. There are several IDEs to choose from for this, which not only offer a clear display and code highlighting, but also provide functions for writing directly to the ESP32. We opted for Visual Studio Code with the PlatformIO extension. 

Terminal display and menu
Web interface of the terminal

Software component II - Odoo module:

In order to enable a user-friendly and seamless integration of the time recording terminal in Odoo, the following requirements were placed on the Odoo module:

  • Use of Odoo standards as far as possible
  • Management of NFC cards in Odoo (blocking, releasing, assigning to employees)
  • Registration/deregistration using the Odoo API
  • Simple connection/configuration to integrate the time recording terminal
  • Enable integration of multiple terminals

The Odoo module was developed by us with the aim of fully integrating the NFC terminal into Odoo. Comprehensive management of the NFC cards with assignment to employees is just as possible as the configuration of the NFC terminal via an optional extension of the IoT app (additional module of manaTec). Our NFC extension is based on the Odoo standard and generates standard attendance entries as a result. This means that further extensions, which enable the time entries to be evaluated, for example, can be used without any adjustments.

Card management in Odoo

Workflow / interaction of software and hardware:

The commissioning terminal​

  1. The terminal opens a WLAN host and makes a network available
  2. Login to the WLAN network via smartphone, tablet or similar
  3. Open the displayed IP in the browser → Perform configuration
  4. After restarting, the terminal dials into the configured WLAN as a client and is ready for operation

The configuration of the NFC cards in Odoo

  1. Setting the API access for the terminal under Presence times → Configuration → Settings → NFC Station API
  2. Create an NFC card under Attendance times (or staff) → NFC → NFC cards
  3. To read the UID of the card, simply open the settings on the terminal (cogwheel symbol) and hold the NFC card in front of you → The UID of the card is displayed
  4. Assigning the card to an employee

Time recording

  1. Have an NFC card available
  2. The terminal recognizes the card and sends the card information to Odoo
  3. Odoo checks whether there is a time entry for the employee linked to the card, which only has clock-in but no clock-out
  4. If an entry exists, the walk time is entered and "Walk" is reported back to the terminal
  5. If there is no open time entry in Odoo for the employee, "Coming" is reported back to the terminal
  6. If the card is invalid or unknown, this is also reported back to the terminal

Summary:

Our focus during the design and implementation of the time recording terminal, including all firmware and software components, was on efficiency and user-friendliness. This is reflected in a wide range of benefits:

Fast set-up: the quick configuration of all components minimizes the time-to-market period, allowing you to benefit directly from the advantages of our solution.

User-friendly operation: Everyday operation is very convenient and self-explanatory. The operating buttons on the touch display, for example, are designed in such a way that they are easy to read and accurate, even for users with large hands.

Preset standard function: A freely configurable standard function is preselected when the terminal is started so that the most frequently used function can be used directly without prior selection. By default, this is the logon and logoff in the Odoo presence recording. After briefly setting up the terminal for the first time, simply hold the assigned NFC card in front of the terminal to log in or out.

Use in the community version: Our time recording terminal can also be used in the community version of Odoo. This means that even companies using the free version of Odoo can benefit from our product.

No user required in Odoo: You do not need a separate user in Odoo to use the time recording terminal. This means that an unlimited number of employees can be created via the HR module, even if the company has fewer licenses than employees. This provides a flexible and cost-effective solution for companies of all sizes.

Remote card blocking: Another outstanding benefit is the ability to block the NFC cards directly in Odoo. This significantly increases security and allows companies to immediately deactivate lost or stolen cards without having to be physically present at the terminal.

If you would also like to benefit from the advantages of efficient time recording in your Odoo, visit our online store and discover our time recording terminal manaTec Timetracking. Contact us now, we will be happy to advise you!


 
Access rights in Odoo
Users and their roles