From 9a2f6fd856c3f52096c70a1a0bdea1c1529fdc44 Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Wed, 17 Sep 2025 11:30:44 +0100 Subject: [PATCH] [UPD] otp_sms_auth_custom --- odex25_ensan/otp_sms_auth_custom/controllers/web_login.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/odex25_ensan/otp_sms_auth_custom/controllers/web_login.py b/odex25_ensan/otp_sms_auth_custom/controllers/web_login.py index 077a8d440..8d30798ec 100644 --- a/odex25_ensan/otp_sms_auth_custom/controllers/web_login.py +++ b/odex25_ensan/otp_sms_auth_custom/controllers/web_login.py @@ -14,9 +14,13 @@ class AuthSignInHome(Home): if not kw.get('otp_mobile_phone'): data['msg'] = 'No mobile phone number provided for OTP!' else: + # Get the target boolean field name for the account_type + target_field = request.env['res.partner'].sudo().get_partner_target_account_type(kw.get('account_type')) + user = request.env['res.users'].sudo().search([ ('login', '=', kw.get('otp_mobile_phone')), - ('partner_id.account_type', '=', kw.get('account_type')) + # ('partner_id.account_type', '=', kw.get('account_type')) + ('partner_id.%s' % target_field, '=', True) ], limit=1) if user: data['status'] = True