[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) <nim@odoo.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user