From df9bfb17da3d22b09c7c026ee528db83bb75fe74 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 10 Jan 2023 16:57:27 +0000 Subject: [PATCH] [FIX] pos_hr: correctly send back to login screen after cancelling badge Current behavior: When a user scans a badge, the user is prompted to enter his pin. If you click on cancel on the pin window you would be sent directly in the pos and no user would be logged in. Steps to reproduce: - setup any employee badge with number and PIN - Enable Multi Employees per Session in POS settings - Open a new session for this POS - Scan the badge with barcode scanner - At password screen, click cancel - No employee is shown in the top right but the session can be used opw-3110299 closes odoo/odoo#111513 X-original-commit: 79a32fca91538a179a0f546a552176b46134c403 Signed-off-by: Trinh Jacky (trj) --- addons/pos_hr/static/src/js/LoginScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pos_hr/static/src/js/LoginScreen.js b/addons/pos_hr/static/src/js/LoginScreen.js index b41ea5ec18d..bc5503d594e 100644 --- a/addons/pos_hr/static/src/js/LoginScreen.js +++ b/addons/pos_hr/static/src/js/LoginScreen.js @@ -22,7 +22,7 @@ patch(LoginScreen.prototype, "pos_hr.LoginScreen methods", { } }, async barcodeCashierAction(code) { - if (await this._super(code)) { + if (await this._super(code) && this.env.pos.get_cashier().id) { this.back(); } },