[UPD] otp_sms_auth_custom
This commit is contained in:
parent
70953d7087
commit
9a2f6fd856
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue