OCA / hr

Odoo Human Resources Addons
GNU Affero General Public License v3.0
221 stars 672 forks source link

[IMP] hr_attendance_rfid: Reader card code #619

Closed fuentes73 closed 5 years ago

fuentes73 commented 5 years ago

Hi, I've been testing hr_attendance_rfid module with Eficent RAS project and I noticed that:

If you have registered the rfid_card_code of each employee with the usb reader, now you have a problem. As it can be converted 0563537489 into 51e69621 and vice versa, Which solution do you think is better?

    • Create a new field rfid_card_hex_code and compute it from rfid_card_code. If rfid_card_code is already a hex code do nothing, just copy the value.
    • Check at register_attendance function if card_code is equal to rfid_card_code or rfid_card_hex_code
  1. Modify register_attendance function in order to compute decimal and hexadecimal value of card_code and check if any is equal to rfid_card_code

I'll open a PR with the chosen solution.

cc @omar7r @hveficent @jbeficent

HviorForgeFlow commented 5 years ago

USB Reader normally have more than one codification allowed. I don't know which USB Reader you have, but on my case I could change codification to 8H REVERSE to fit with hexadecimal readers.

fuentes73 commented 5 years ago

Didn't remember of this issue. @hveficent Thank's for the info.