diff options
| author | dip-odoo <dip@odoo.com> | 2018-02-08 17:38:03 +0530 |
|---|---|---|
| committer | RomainLibert <rli@odoo.com> | 2018-05-04 18:07:31 +0200 |
| commit | 362613a2fa5dd99ae9b0521b6695badb512f5600 (patch) | |
| tree | 4bef20f9b354d4deded79b75af3580a168faf065 /addons/auth_signup/controllers/main.py | |
| parent | 2f15a5fa647d55df36c9019df467802a3aa9b4e3 (diff) | |
[IMP] auth_signup: change email invitation condition
Currently if a user has already been invited you cannot invite him again
via the web_settings_dashboard as it automatically tries to create a new
user.
This commit changes that behaviour in case you have the mail app
installed odoo will now send an invitation email to the invited user as
long as this user has never connected.
1) Mail app not installed:
- if user is active > display error (this email is already in use)
- if user not active > activate the user
- if user doesn't exist > create new user
2) Mail app installed:
- if user is active && state confirmed > display popup (this email is
already in use)
- if user is active && never connected > resend invitation mail
- if user is inactive > activate the user
- if user doesn't exist > create new user and send invitation mail
This commit is related to task #54023
Closes #23081
Diffstat (limited to 'addons/auth_signup/controllers/main.py')
| -rw-r--r-- | addons/auth_signup/controllers/main.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py index b8bdb9787b3..189c3cc8337 100644 --- a/addons/auth_signup/controllers/main.py +++ b/addons/auth_signup/controllers/main.py @@ -6,6 +6,7 @@ import werkzeug from odoo import http, _ from odoo.addons.auth_signup.models.res_users import SignupError from odoo.addons.web.controllers.main import ensure_db, Home +from odoo.addons.web_settings_dashboard.controllers.main import WebSettingsDashboard as Dashboard from odoo.exceptions import UserError from odoo.http import request @@ -133,3 +134,10 @@ class AuthSignupHome(Home): uid = request.session.authenticate(db, login, password) if not uid: raise SignupError(_('Authentication Failed.')) + +class WebSettingsDashboard(Dashboard): + @http.route('/web_settings_dashboard/data', type='json', auth='user') + def web_settings_dashboard_data(self, **kw): + res = super(WebSettingsDashboard, self).web_settings_dashboard_data(**kw) + res['users_info'].update({'resend_invitation': True}) + return res |
