Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3033 Widoki

I'm working on Odoo.sh V13.

I have added new fields to the signup form. 

When I try to sign up, it sometimes does not work, and  I  get  the  error:

Could not create a new account.

to debug, I edited this code in the method do_signup:


except (SignupError, AssertionError) as e:
if request.env["res.users"].sudo().search(
[("login", "=", qcontext.get("login").replace(' ', '').lower())]):
qcontext["error"] = _("Another user is already registered using this email address.")
else:
_logger.error("%s", e)
if SignupError:
_logger.error("%s", SignupError)
if AssertionError:
_logger.error("%s", AssertionError)
qcontext['error'] = _("Could not create a new account.")
And in the log file, I get:

odoo.addons.fl_auth_signup.controllers.main: Expecting value: line 1 column 1 (char 0)
odoo.addons.fl_auth_signup.controllers.main: class 'odoo.addons.auth_signup.models.res_partner.SignupError'
odoo.addons.fl_auth_signup.controllers.main: class 'AssertionError'

 

What are SignupError and AssertionError? 

And why do they both show at he same time?

And why does my code often works but sometimes not (with the same values in the form)?





Awatar
Odrzuć
Najlepsza odpowiedź

Hi, this might help you: https://youtu.be/An6YTH3kJD8

Thanks

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
6
sty 24
36382
0
paź 15
11323
1
gru 24
3862
0
lis 24
1598
2
lip 24
3251