From ba69b1d534883960dceb49ed558d3a4229864e97 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Mon, 13 Jan 2020 10:13:00 +0000 Subject: [PATCH] [FIX] hr: fix badge generation for cashier Open Employees>[DEMO]. Go to HR Settings and generate badge id Now go to POS Settings, enable "Login with Employees". Now open the session and login by scanning the [DEMO] employee badge. The badge will not be recognized, this is caused by the fact that the badge is 8 digits randomly generated, while the parser recognize cashiers only if the barcode has a prefix of 041. Fixed the badge id generation, and adjusted the length to other barcodes in the system opw-2151942 closes odoo/odoo#43228 X-original-commit: 90bcda64ba6058169b48ff8214e7c2a98eb9a0f8 Signed-off-by: Nicolas Martinelli (nim) --- addons/hr/models/hr_employee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index 1ddd3f77bd2..4f2bdafd323 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -291,7 +291,7 @@ class HrEmployeePrivate(models.Model): def generate_random_barcode(self): for employee in self: - employee.barcode = "".join(choice(digits) for i in range(8)) + employee.barcode = '041'+"".join(choice(digits) for i in range(9)) @api.depends('address_home_id.parent_id') def _compute_is_address_home_a_company(self):