From 41ceffd52b8c5cb606c1a57d2985f57eec2a3926 Mon Sep 17 00:00:00 2001
From: Raphael Collet
Date: Mon, 3 Dec 2012 15:44:24 +0100
Subject: [PATCH 1/4] [ADD] auth_signup: merge in functionality of
auth_reset_password
bzr revid: rco@openerp.com-20121203144424-39wrr5z78smswox2
---
addons/auth_signup/__openerp__.py | 9 ++--
addons/auth_signup/auth_signup_data.xml | 15 +++++++
addons/auth_signup/controllers/main.py | 21 +++++++++-
addons/auth_signup/res_users.py | 41 ++++++++++++++++---
addons/auth_signup/res_users_view.xml | 12 ++++++
.../auth_signup/static/src/js/auth_signup.js | 29 ++++++++++++-
.../static/src/xml/auth_signup.xml | 3 ++
7 files changed, 120 insertions(+), 10 deletions(-)
diff --git a/addons/auth_signup/__openerp__.py b/addons/auth_signup/__openerp__.py
index 235ac047346..5fe705a4440 100644
--- a/addons/auth_signup/__openerp__.py
+++ b/addons/auth_signup/__openerp__.py
@@ -22,15 +22,18 @@
{
'name': 'Signup',
'description': """
-Allow users to sign up.
-=======================
+Allow users to sign up and reset their password
+===============================================
""",
'author': 'OpenERP SA',
'version': '1.0',
'category': 'Authentication',
'website': 'http://www.openerp.com',
'installable': True,
- 'depends': ['base_setup'],
+ 'depends': [
+ 'base_setup',
+ 'email_template',
+ ],
'data': [
'auth_signup_data.xml',
'res_config.xml',
diff --git a/addons/auth_signup/auth_signup_data.xml b/addons/auth_signup/auth_signup_data.xml
index 39b62148494..32e397b1ba6 100644
--- a/addons/auth_signup/auth_signup_data.xml
+++ b/addons/auth_signup/auth_signup_data.xml
@@ -18,5 +18,20 @@
+
+
+ Reset Password
+
+ ]]>
+ ${object.email}
+ Password reset
+ A password reset was requested for the OpenERP account linked to this email.
+
+You may change your password by following this link .
+
+Note: If you do not expect this, you can safely ignore this email.
]]>
+
+
diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py
index 888d2131f42..a2b77502737 100644
--- a/addons/auth_signup/controllers/main.py
+++ b/addons/auth_signup/controllers/main.py
@@ -19,10 +19,12 @@
#
##############################################################################
import logging
+import urllib
+
+import werkzeug
import openerp
from openerp.modules.registry import RegistryManager
-
from ..res_users import SignupError
_logger = logging.getLogger(__name__)
@@ -56,4 +58,21 @@ class Controller(openerp.addons.web.http.Controller):
cr.commit()
return {}
+ @openerp.addons.web.http.httprequest
+ def reset_password(self, req, dbname, login):
+ """ retrieve user, and perform reset password """
+ registry = RegistryManager.get(dbname)
+ with registry.cursor() as cr:
+ try:
+ res_users = registry.get('res.users')
+ res_users.reset_password(cr, openerp.SUPERUSER_ID, login)
+ cr.commit()
+ message = 'An email has been sent with credentials to reset your password'
+ except Exception as e:
+ # signup error
+ _logger.exception('error when resetting password')
+ message = e.message
+ params = [('action', 'login'), ('error_message', message)]
+ return werkzeug.utils.redirect("/#" + urllib.urlencode(params))
+
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index 7dbb19853a2..de6ec37a45e 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -18,14 +18,15 @@
# along with this program. If not, see
#
##############################################################################
+from datetime import datetime, timedelta
import random
-import time
import urllib
import urlparse
from openerp.osv import osv, fields
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.tools.safe_eval import safe_eval
+from openerp.tools.translate import _
class SignupError(Exception):
pass
@@ -33,10 +34,12 @@ class SignupError(Exception):
def random_token():
# the token has an entropy of about 120 bits (6 bits/char * 20 chars)
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
- return ''.join(random.choice(chars) for _ in xrange(20))
+ return ''.join(random.choice(chars) for i in xrange(20))
+
+def now(**kwargs):
+ dt = datetime.now() + timedelta(**kwargs)
+ return dt.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
-def now():
- return time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
class res_partner(osv.Model):
_inherit = 'res.partner'
@@ -58,7 +61,7 @@ class res_partner(osv.Model):
# when required, make sure the partner has a valid signup token
if context and context.get('signup_valid') and not partner.user_ids:
self.signup_prepare(cr, uid, [partner.id], context=context)
-
+
action_template = None
params = {
'action': urllib.quote(action),
@@ -218,3 +221,31 @@ class res_users(osv.Model):
# create a copy of the template user (attached to a specific partner_id if given)
values['active'] = True
return self.copy(cr, uid, template_user_id, values, context=context)
+
+ def reset_password(self, cr, uid, login, context=None):
+ """ retrieve the user corresponding to login (login or email),
+ and reset their password
+ """
+ user_ids = self.search(cr, uid, [('login', '=', login)], context=context)
+ if not user_ids:
+ user_ids = self.search(cr, uid, [('email', '=', login)], context=context)
+ if len(user_ids) != 1:
+ raise Exception('Reset password: invalid username or email')
+ return self.action_reset_password(cr, uid, user_ids, context=context)
+
+ def action_reset_password(self, cr, uid, ids, context=None):
+ """ create signup token for each user, and send their signup url by email """
+ # prepare reset password signup
+ res_partner = self.pool.get('res.partner')
+ partner_ids = [user.partner_id.id for user in self.browse(cr, uid, ids, context)]
+ res_partner.signup_prepare(cr, uid, partner_ids, expiration=now(days=+1), context=context)
+
+ # send email to users with their signup url
+ template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'reset_password_email')
+ assert template._name == 'email.template'
+ for user in self.browse(cr, uid, ids, context):
+ if not user.email:
+ raise osv.except_osv(_("Cannot send email: user has no email address."), user.name)
+ self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
+
+ return True
diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml
index c42e1ab5f41..90729c54285 100644
--- a/addons/auth_signup/res_users_view.xml
+++ b/addons/auth_signup/res_users_view.xml
@@ -7,11 +7,23 @@
res.users
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js
index 241c2406d56..562332556ab 100644
--- a/addons/auth_signup/static/src/js/auth_signup.js
+++ b/addons/auth_signup/static/src/js/auth_signup.js
@@ -43,8 +43,13 @@ openerp.auth_signup = function(instance) {
.fail(self.on_token_failed)
});
}
+
+ // bind reset password link
+ this.$('a.oe_reset_password').click(this.do_reset_password);
+
return d;
},
+
on_token_loaded: function(result) {
// select the right the database
this.selected_db = result.db;
@@ -66,6 +71,7 @@ openerp.auth_signup = function(instance) {
this.$("form input[name=login]").val(result.login || "");
}
},
+
on_token_failed: function(result, ev) {
if (ev) {
ev.preventDefault();
@@ -74,6 +80,7 @@ openerp.auth_signup = function(instance) {
delete this.params.db;
delete this.params.token;
},
+
on_submit: function(ev) {
if (ev) {
ev.preventDefault();
@@ -124,6 +131,26 @@ openerp.auth_signup = function(instance) {
this._super(ev);
}
},
- });
+ do_reset_password: function(ev) {
+ if (ev) {
+ ev.preventDefault();
+ }
+ var db = this.$("form [name=db]").val();
+ var login = this.$("form input[name=login]").val();
+ if (!db) {
+ this.do_warn("Login", "No database selected !");
+ return false;
+ } else if (!login) {
+ this.do_warn("Login", "Please enter a username or email address.")
+ return false;
+ }
+ var params = {
+ dbname : db,
+ login: login,
+ };
+ var url = "/auth_signup/reset_password?" + $.param(params);
+ window.location = url;
+ },
+ });
};
diff --git a/addons/auth_signup/static/src/xml/auth_signup.xml b/addons/auth_signup/static/src/xml/auth_signup.xml
index a51ced3778d..d1ae437860f 100644
--- a/addons/auth_signup/static/src/xml/auth_signup.xml
+++ b/addons/auth_signup/static/src/xml/auth_signup.xml
@@ -24,6 +24,9 @@
Back to Login
+
+ Reset password
+
From 4d200952f7500eb070c656024dc27411f8f02825 Mon Sep 17 00:00:00 2001
From: Raphael Collet
Date: Mon, 3 Dec 2012 16:48:11 +0100
Subject: [PATCH 2/4] [IMP] auth_signup: on login page, show the links 'Sign
Up' and 'Reset Password' only when enabled
bzr revid: rco@openerp.com-20121203154811-1v0f3eu444rkw6cp
---
addons/auth_signup/controllers/main.py | 12 ++++++++++++
addons/auth_signup/res_config.py | 10 ++++++++--
addons/auth_signup/res_config.xml | 4 ++++
addons/auth_signup/static/src/js/auth_signup.js | 17 ++++++++++++++++-
.../auth_signup/static/src/xml/auth_signup.xml | 4 +---
5 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py
index a2b77502737..d2429e8dfd2 100644
--- a/addons/auth_signup/controllers/main.py
+++ b/addons/auth_signup/controllers/main.py
@@ -32,6 +32,18 @@ _logger = logging.getLogger(__name__)
class Controller(openerp.addons.web.http.Controller):
_cp_path = '/auth_signup'
+ @openerp.addons.web.http.jsonrequest
+ def get_config(self, req, dbname):
+ """ retrieve the module config (which features are enabled) for the login page """
+ registry = RegistryManager.get(dbname)
+ with registry.cursor() as cr:
+ icp = registry.get('ir.config_parameter')
+ config = {
+ 'signup': icp.get_param(cr, openerp.SUPERUSER_ID, 'auth_signup.allow_uninvited') == 'True',
+ 'reset_password': icp.get_param(cr, openerp.SUPERUSER_ID, 'auth_signup.reset_password') == 'True',
+ }
+ return config
+
@openerp.addons.web.http.jsonrequest
def retrieve(self, req, dbname, token):
""" retrieve the user info (name, login or email) corresponding to a signup token """
diff --git a/addons/auth_signup/res_config.py b/addons/auth_signup/res_config.py
index 21fce19745c..9cdb41568ff 100644
--- a/addons/auth_signup/res_config.py
+++ b/addons/auth_signup/res_config.py
@@ -26,14 +26,19 @@ class base_config_settings(osv.TransientModel):
_inherit = 'base.config.settings'
_columns = {
- 'auth_signup_uninvited': fields.boolean('Allow external users to sign up', help="If unchecked, only invited users may sign up"),
- 'auth_signup_template_user_id': fields.many2one('res.users', 'Template user for new users created through signup'),
+ 'auth_signup_reset_password': fields.boolean('Enable password reset from Login page',
+ help="This allows users to trigger a password reset from the Login page."),
+ 'auth_signup_uninvited': fields.boolean('Allow external users to sign up',
+ help="If unchecked, only invited users may sign up."),
+ 'auth_signup_template_user_id': fields.many2one('res.users',
+ string='Template user for new users created through signup'),
}
def get_default_auth_signup_template_user_id(self, cr, uid, fields, context=None):
icp = self.pool.get('ir.config_parameter')
# we use safe_eval on the result, since the value of the parameter is a nonempty string
return {
+ 'auth_signup_reset_password': safe_eval(icp.get_param(cr, uid, 'auth_signup.reset_password', 'False')),
'auth_signup_uninvited': safe_eval(icp.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')),
'auth_signup_template_user_id': safe_eval(icp.get_param(cr, uid, 'auth_signup.template_user_id', 'False')),
}
@@ -42,5 +47,6 @@ class base_config_settings(osv.TransientModel):
config = self.browse(cr, uid, ids[0], context=context)
icp = self.pool.get('ir.config_parameter')
# we store the repr of the values, since the value of the parameter is a required string
+ icp.set_param(cr, uid, 'auth_signup.reset_password', repr(config.auth_signup_reset_password))
icp.set_param(cr, uid, 'auth_signup.allow_uninvited', repr(config.auth_signup_uninvited))
icp.set_param(cr, uid, 'auth_signup.template_user_id', repr(config.auth_signup_template_user_id.id))
diff --git a/addons/auth_signup/res_config.xml b/addons/auth_signup/res_config.xml
index 9d3eb4eaa5a..86c56a065a7 100644
--- a/addons/auth_signup/res_config.xml
+++ b/addons/auth_signup/res_config.xml
@@ -8,6 +8,10 @@
+
+
+
+
diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js
index 562332556ab..14308955272 100644
--- a/addons/auth_signup/static/src/js/auth_signup.js
+++ b/addons/auth_signup/static/src/js/auth_signup.js
@@ -45,7 +45,22 @@ openerp.auth_signup = function(instance) {
}
// bind reset password link
- this.$('a.oe_reset_password').click(this.do_reset_password);
+ this.$('a.oe_signup_reset_password').click(this.do_reset_password);
+
+ // make signup link and reset password link visible only when enabled
+ this.$('a.oe_signup_signup').hide();
+ this.$('a.oe_signup_reset_password').hide();
+ if (this.params.db) {
+ this.rpc("/auth_signup/get_config", {dbname: self.params.db})
+ .done(function(result) {
+ if (result.signup) {
+ self.$('a.oe_signup_signup').show();
+ }
+ if (result.reset_password) {
+ self.$('a.oe_signup_reset_password').show();
+ }
+ });
+ }
return d;
},
diff --git a/addons/auth_signup/static/src/xml/auth_signup.xml b/addons/auth_signup/static/src/xml/auth_signup.xml
index d1ae437860f..d1c04cb6807 100644
--- a/addons/auth_signup/static/src/xml/auth_signup.xml
+++ b/addons/auth_signup/static/src/xml/auth_signup.xml
@@ -22,11 +22,9 @@
Sign up
Sign Up
Back to Login
+
Reset password
-
- Reset password
-
From 1ea7171ae92218ceaf9340db8b178bd967dd51b9 Mon Sep 17 00:00:00 2001
From: Raphael Collet
Date: Mon, 3 Dec 2012 16:50:05 +0100
Subject: [PATCH 3/4] [REM] auth_reset_password: functionality is taken over by
auth_signup
bzr revid: rco@openerp.com-20121203155005-cl6pu8dj9joagata
---
addons/auth_reset_password/__init__.py | 23 -----
addons/auth_reset_password/__openerp__.py | 43 ----------
.../auth_reset_password.xml | 21 -----
.../controllers/__init__.py | 24 ------
.../auth_reset_password/controllers/main.py | 52 ------------
addons/auth_reset_password/i18n/ar.po | 74 -----------------
.../i18n/auth_reset_password.pot | 69 ---------------
addons/auth_reset_password/i18n/it.po | 74 -----------------
addons/auth_reset_password/i18n/nl.po | 74 -----------------
addons/auth_reset_password/i18n/ru.po | 74 -----------------
addons/auth_reset_password/i18n/tr.po | 83 -------------------
addons/auth_reset_password/i18n/zh_CN.po | 78 -----------------
addons/auth_reset_password/res_users.py | 62 --------------
addons/auth_reset_password/res_users_view.xml | 25 ------
.../static/src/js/reset_password.js | 30 -------
.../static/src/xml/reset_password.xml | 11 ---
16 files changed, 817 deletions(-)
delete mode 100644 addons/auth_reset_password/__init__.py
delete mode 100644 addons/auth_reset_password/__openerp__.py
delete mode 100644 addons/auth_reset_password/auth_reset_password.xml
delete mode 100644 addons/auth_reset_password/controllers/__init__.py
delete mode 100644 addons/auth_reset_password/controllers/main.py
delete mode 100644 addons/auth_reset_password/i18n/ar.po
delete mode 100644 addons/auth_reset_password/i18n/auth_reset_password.pot
delete mode 100644 addons/auth_reset_password/i18n/it.po
delete mode 100644 addons/auth_reset_password/i18n/nl.po
delete mode 100644 addons/auth_reset_password/i18n/ru.po
delete mode 100644 addons/auth_reset_password/i18n/tr.po
delete mode 100644 addons/auth_reset_password/i18n/zh_CN.po
delete mode 100644 addons/auth_reset_password/res_users.py
delete mode 100644 addons/auth_reset_password/res_users_view.xml
delete mode 100644 addons/auth_reset_password/static/src/js/reset_password.js
delete mode 100644 addons/auth_reset_password/static/src/xml/reset_password.xml
diff --git a/addons/auth_reset_password/__init__.py b/addons/auth_reset_password/__init__.py
deleted file mode 100644
index 8341ccd60c7..00000000000
--- a/addons/auth_reset_password/__init__.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2012-today OpenERP SA ()
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see
-#
-##############################################################################
-
-import controllers
-import res_users
diff --git a/addons/auth_reset_password/__openerp__.py b/addons/auth_reset_password/__openerp__.py
deleted file mode 100644
index 2c5b61bf378..00000000000
--- a/addons/auth_reset_password/__openerp__.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2012-today OpenERP SA ()
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see
-#
-##############################################################################
-
-{
- 'name': 'Reset Password',
- 'description': """
-Reset Password
-==============
-
-Allow users to reset their password from the login page.
-Allow administrator to click a button to send a "Reset Password" request to a user.
-""",
- 'author': 'OpenERP SA',
- 'version': '1.0',
- 'category': 'Authentication',
- 'website': 'http://www.openerp.com',
- 'installable': True,
- 'depends': ['auth_signup', 'email_template'],
- 'data': [
- 'auth_reset_password.xml',
- 'res_users_view.xml',
- ],
- 'js': ['static/src/js/reset_password.js'],
- 'qweb': ['static/src/xml/reset_password.xml'],
-}
diff --git a/addons/auth_reset_password/auth_reset_password.xml b/addons/auth_reset_password/auth_reset_password.xml
deleted file mode 100644
index 90f08a25899..00000000000
--- a/addons/auth_reset_password/auth_reset_password.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
- Reset Password
-
- ]]>
- ${object.email}
- Password reset
- A password reset was requested for the OpenERP account linked to this email.
-
-You may change your password following this link .
-
-Note: If you did not ask for a password reset, you can safely ignore this email.
]]>
-
-
-
-
diff --git a/addons/auth_reset_password/controllers/__init__.py b/addons/auth_reset_password/controllers/__init__.py
deleted file mode 100644
index f40f0ee976e..00000000000
--- a/addons/auth_reset_password/controllers/__init__.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2012-today OpenERP SA ()
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see
-#
-##############################################################################
-
-import main
-
-# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auth_reset_password/controllers/main.py b/addons/auth_reset_password/controllers/main.py
deleted file mode 100644
index 639945cfc09..00000000000
--- a/addons/auth_reset_password/controllers/main.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2012-today OpenERP SA ()
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see
-#
-##############################################################################
-import logging
-
-import werkzeug
-
-import openerp
-from openerp import SUPERUSER_ID
-from openerp.modules.registry import RegistryManager
-
-_logger = logging.getLogger(__name__)
-
-class Controller(openerp.addons.web.http.Controller):
- _cp_path = '/auth_reset_password'
-
- @openerp.addons.web.http.httprequest
- def reset_password(self, req, dbname, login):
- """ retrieve user, and perform reset password """
- url = '/'
- registry = RegistryManager.get(dbname)
- with registry.cursor() as cr:
- try:
- res_users = registry.get('res.users')
- res_users.reset_password(cr, SUPERUSER_ID, login)
- cr.commit()
- message = 'An email has been sent with credentials to reset your password'
- except Exception as e:
- # signup error
- _logger.exception('error when resetting password')
- message = e.message
- url = "/#action=login&error_message=%s" % werkzeug.urls.url_quote(message)
- return werkzeug.utils.redirect(url)
-
-# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auth_reset_password/i18n/ar.po b/addons/auth_reset_password/i18n/ar.po
deleted file mode 100644
index 37447b687bd..00000000000
--- a/addons/auth_reset_password/i18n/ar.po
+++ /dev/null
@@ -1,74 +0,0 @@
-# Arabic translation for openobject-addons
-# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2012-11-24 02:52+0000\n"
-"PO-Revision-Date: 2012-12-01 10:40+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Arabic \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-12-02 04:38+0000\n"
-"X-Generator: Launchpad (build 16319)\n"
-
-#. module: auth_reset_password
-#: model:email.template,body_html:auth_reset_password.reset_password_email
-msgid ""
-"\n"
-"A password reset was requested for the OpenERP account linked to this "
-"email.
\n"
-"\n"
-"You may change your password following this link .
\n"
-"\n"
-"Note: If you did not ask for a password reset, you can safely ignore this "
-"email.
"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "You can not have two users with the same login !"
-msgstr ""
-
-#. module: auth_reset_password
-#: model:ir.model,name:auth_reset_password.model_res_users
-msgid "Users"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "OAuth UID must be unique per provider"
-msgstr ""
-
-#. module: auth_reset_password
-#: view:res.users:0
-msgid "Reset Password"
-msgstr ""
-
-#. module: auth_reset_password
-#: model:email.template,subject:auth_reset_password.reset_password_email
-msgid "Password reset"
-msgstr ""
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "Error: Invalid ean code"
-msgstr ""
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "The chosen company is not in the allowed companies for this user"
-msgstr ""
-
-#. module: auth_reset_password
-#. openerp-web
-#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7
-#, python-format
-msgid "Reset password"
-msgstr ""
diff --git a/addons/auth_reset_password/i18n/auth_reset_password.pot b/addons/auth_reset_password/i18n/auth_reset_password.pot
deleted file mode 100644
index 58100f926a2..00000000000
--- a/addons/auth_reset_password/i18n/auth_reset_password.pot
+++ /dev/null
@@ -1,69 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * auth_reset_password
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 7.0alpha\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-11-24 02:52+0000\n"
-"PO-Revision-Date: 2012-11-24 02:52+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: auth_reset_password
-#: model:email.template,body_html:auth_reset_password.reset_password_email
-msgid "\n"
-"A password reset was requested for the OpenERP account linked to this email.
\n"
-"\n"
-"You may change your password following this link .
\n"
-"\n"
-"Note: If you did not ask for a password reset, you can safely ignore this email.
"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "You can not have two users with the same login !"
-msgstr ""
-
-#. module: auth_reset_password
-#: model:ir.model,name:auth_reset_password.model_res_users
-msgid "Users"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "OAuth UID must be unique per provider"
-msgstr ""
-
-#. module: auth_reset_password
-#: view:res.users:0
-msgid "Reset Password"
-msgstr ""
-
-#. module: auth_reset_password
-#: model:email.template,subject:auth_reset_password.reset_password_email
-msgid "Password reset"
-msgstr ""
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "Error: Invalid ean code"
-msgstr ""
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "The chosen company is not in the allowed companies for this user"
-msgstr ""
-
-#. module: auth_reset_password
-#. openerp-web
-#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7
-#, python-format
-msgid "Reset password"
-msgstr ""
-
diff --git a/addons/auth_reset_password/i18n/it.po b/addons/auth_reset_password/i18n/it.po
deleted file mode 100644
index c330056fe66..00000000000
--- a/addons/auth_reset_password/i18n/it.po
+++ /dev/null
@@ -1,74 +0,0 @@
-# Italian translation for openobject-addons
-# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2012-11-24 02:52+0000\n"
-"PO-Revision-Date: 2012-11-28 19:58+0000\n"
-"Last-Translator: Davide Corio - agilebg.com \n"
-"Language-Team: Italian \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-11-29 05:15+0000\n"
-"X-Generator: Launchpad (build 16319)\n"
-
-#. module: auth_reset_password
-#: model:email.template,body_html:auth_reset_password.reset_password_email
-msgid ""
-"\n"
-"A password reset was requested for the OpenERP account linked to this "
-"email.
\n"
-"\n"
-"You may change your password following this link .
\n"
-"\n"
-"Note: If you did not ask for a password reset, you can safely ignore this "
-"email.
"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "You can not have two users with the same login !"
-msgstr "Non è possibile avere due utenti con lo stesso login!"
-
-#. module: auth_reset_password
-#: model:ir.model,name:auth_reset_password.model_res_users
-msgid "Users"
-msgstr "Utenti"
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "OAuth UID must be unique per provider"
-msgstr "il UID OAuth deve essere unico per provider"
-
-#. module: auth_reset_password
-#: view:res.users:0
-msgid "Reset Password"
-msgstr "Reimposta Password"
-
-#. module: auth_reset_password
-#: model:email.template,subject:auth_reset_password.reset_password_email
-msgid "Password reset"
-msgstr "Ripristino password"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "Error: Invalid ean code"
-msgstr "Errore: codice EAN non valido"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "The chosen company is not in the allowed companies for this user"
-msgstr "L'azienda scelta non è fra le aziende abilitate per questo utente"
-
-#. module: auth_reset_password
-#. openerp-web
-#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7
-#, python-format
-msgid "Reset password"
-msgstr "Reimposta password"
diff --git a/addons/auth_reset_password/i18n/nl.po b/addons/auth_reset_password/i18n/nl.po
deleted file mode 100644
index 501b9abae97..00000000000
--- a/addons/auth_reset_password/i18n/nl.po
+++ /dev/null
@@ -1,74 +0,0 @@
-# Dutch translation for openobject-addons
-# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2012-11-24 02:52+0000\n"
-"PO-Revision-Date: 2012-11-29 15:12+0000\n"
-"Last-Translator: Erwin van der Ploeg (Endian Solutions) \n"
-"Language-Team: Dutch \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-11-30 05:08+0000\n"
-"X-Generator: Launchpad (build 16319)\n"
-
-#. module: auth_reset_password
-#: model:email.template,body_html:auth_reset_password.reset_password_email
-msgid ""
-"\n"
-"A password reset was requested for the OpenERP account linked to this "
-"email.
\n"
-"\n"
-"You may change your password following this link .
\n"
-"\n"
-"Note: If you did not ask for a password reset, you can safely ignore this "
-"email.
"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "You can not have two users with the same login !"
-msgstr "U kunt niet twee gebruikers hebben met dezelfde gebruikersnaam !"
-
-#. module: auth_reset_password
-#: model:ir.model,name:auth_reset_password.model_res_users
-msgid "Users"
-msgstr "Gebruikers"
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "OAuth UID must be unique per provider"
-msgstr "OAuth UID moet uniek zijn per provider"
-
-#. module: auth_reset_password
-#: view:res.users:0
-msgid "Reset Password"
-msgstr "Stel wachtwoord opnieuw in"
-
-#. module: auth_reset_password
-#: model:email.template,subject:auth_reset_password.reset_password_email
-msgid "Password reset"
-msgstr "Reset wachtwoord"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "Error: Invalid ean code"
-msgstr "Fout: Ongeldige EAN-code"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "The chosen company is not in the allowed companies for this user"
-msgstr "Het gekozen bedrijf is geen toegestaan bedrijf voor deze gebruiker"
-
-#. module: auth_reset_password
-#. openerp-web
-#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7
-#, python-format
-msgid "Reset password"
-msgstr "Reset wachtwoord"
diff --git a/addons/auth_reset_password/i18n/ru.po b/addons/auth_reset_password/i18n/ru.po
deleted file mode 100644
index 0f80ee26a7f..00000000000
--- a/addons/auth_reset_password/i18n/ru.po
+++ /dev/null
@@ -1,74 +0,0 @@
-# Russian translation for openobject-addons
-# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2012-11-24 02:52+0000\n"
-"PO-Revision-Date: 2012-11-30 19:40+0000\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: Russian \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-12-01 05:09+0000\n"
-"X-Generator: Launchpad (build 16319)\n"
-
-#. module: auth_reset_password
-#: model:email.template,body_html:auth_reset_password.reset_password_email
-msgid ""
-"\n"
-"A password reset was requested for the OpenERP account linked to this "
-"email.
\n"
-"\n"
-"You may change your password following this link .
\n"
-"\n"
-"Note: If you did not ask for a password reset, you can safely ignore this "
-"email.
"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "You can not have two users with the same login !"
-msgstr ""
-
-#. module: auth_reset_password
-#: model:ir.model,name:auth_reset_password.model_res_users
-msgid "Users"
-msgstr ""
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "OAuth UID must be unique per provider"
-msgstr ""
-
-#. module: auth_reset_password
-#: view:res.users:0
-msgid "Reset Password"
-msgstr ""
-
-#. module: auth_reset_password
-#: model:email.template,subject:auth_reset_password.reset_password_email
-msgid "Password reset"
-msgstr ""
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "Error: Invalid ean code"
-msgstr ""
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "The chosen company is not in the allowed companies for this user"
-msgstr ""
-
-#. module: auth_reset_password
-#. openerp-web
-#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7
-#, python-format
-msgid "Reset password"
-msgstr ""
diff --git a/addons/auth_reset_password/i18n/tr.po b/addons/auth_reset_password/i18n/tr.po
deleted file mode 100644
index 3feaf33754c..00000000000
--- a/addons/auth_reset_password/i18n/tr.po
+++ /dev/null
@@ -1,83 +0,0 @@
-# Turkish translation for openobject-addons
-# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2012-11-24 02:52+0000\n"
-"PO-Revision-Date: 2012-11-27 22:15+0000\n"
-"Last-Translator: Ahmet Altınışık \n"
-"Language-Team: Turkish \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-11-28 04:41+0000\n"
-"X-Generator: Launchpad (build 16309)\n"
-
-#. module: auth_reset_password
-#: model:email.template,body_html:auth_reset_password.reset_password_email
-msgid ""
-"\n"
-"A password reset was requested for the OpenERP account linked to this "
-"email.
\n"
-"\n"
-"You may change your password following this link .
\n"
-"\n"
-"Note: If you did not ask for a password reset, you can safely ignore this "
-"email.
"
-msgstr ""
-"\n"
-"Bu epostayla ilişkili OpenERP hesabı için bir parola sıfırlama isteği "
-"istendi.
\n"
-"\n"
-"Şifrenizi şu adresten değiştirebilirsiniz. this link .
\n"
-"\n"
-"Not: Eğer bu parola değiştirme isteğini siz yapmadıysanız bu mesajı "
-"görmezden gelebilirsiniz.
"
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "You can not have two users with the same login !"
-msgstr "Aynı kullanıcı adı ile iki kullanıcı oluşturamazsınız !"
-
-#. module: auth_reset_password
-#: model:ir.model,name:auth_reset_password.model_res_users
-msgid "Users"
-msgstr "Kullanıcılar"
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "OAuth UID must be unique per provider"
-msgstr "OAuth UID her sağlayıcı için tekil olmalı"
-
-#. module: auth_reset_password
-#: view:res.users:0
-msgid "Reset Password"
-msgstr "Parolayı Sıfırla"
-
-#. module: auth_reset_password
-#: model:email.template,subject:auth_reset_password.reset_password_email
-msgid "Password reset"
-msgstr "Parola sıfırlandı"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "Error: Invalid ean code"
-msgstr "Hata: Geçersiz EAN barkodu"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "The chosen company is not in the allowed companies for this user"
-msgstr "Seçilen şirket bu kullanıcı için izin verilen şirketler arasında yok"
-
-#. module: auth_reset_password
-#. openerp-web
-#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7
-#, python-format
-msgid "Reset password"
-msgstr "Parolayı sıfırla"
diff --git a/addons/auth_reset_password/i18n/zh_CN.po b/addons/auth_reset_password/i18n/zh_CN.po
deleted file mode 100644
index ee06973b4c6..00000000000
--- a/addons/auth_reset_password/i18n/zh_CN.po
+++ /dev/null
@@ -1,78 +0,0 @@
-# Chinese (Simplified) translation for openobject-addons
-# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
-# This file is distributed under the same license as the openobject-addons package.
-# FIRST AUTHOR , 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: openobject-addons\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2012-11-24 02:52+0000\n"
-"PO-Revision-Date: 2012-11-28 07:14+0000\n"
-"Last-Translator: ccdos \n"
-"Language-Team: Chinese (Simplified) \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-11-29 05:15+0000\n"
-"X-Generator: Launchpad (build 16319)\n"
-
-#. module: auth_reset_password
-#: model:email.template,body_html:auth_reset_password.reset_password_email
-msgid ""
-"\n"
-"A password reset was requested for the OpenERP account linked to this "
-"email.
\n"
-"\n"
-"You may change your password following this link .
\n"
-"\n"
-"Note: If you did not ask for a password reset, you can safely ignore this "
-"email.
"
-msgstr ""
-"\n"
-"一个关联到这个Email地址的Openerp帐号请求复位密码。\n"
-"你可以修改你的密码通过下面这个链接 。\n"
-"提醒:如果你没请求复位密码,请忽略这封邮件。"
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "You can not have two users with the same login !"
-msgstr "两个用户不能使用相同的用户名!"
-
-#. module: auth_reset_password
-#: model:ir.model,name:auth_reset_password.model_res_users
-msgid "Users"
-msgstr "用户"
-
-#. module: auth_reset_password
-#: sql_constraint:res.users:0
-msgid "OAuth UID must be unique per provider"
-msgstr "OAuth UID必须是每个提供者唯一的"
-
-#. module: auth_reset_password
-#: view:res.users:0
-msgid "Reset Password"
-msgstr "重置密码"
-
-#. module: auth_reset_password
-#: model:email.template,subject:auth_reset_password.reset_password_email
-msgid "Password reset"
-msgstr "重置密码"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "Error: Invalid ean code"
-msgstr "错误:无效的(EAN)条码"
-
-#. module: auth_reset_password
-#: constraint:res.users:0
-msgid "The chosen company is not in the allowed companies for this user"
-msgstr "选择的公司不属于此用户允许访问的公司。"
-
-#. module: auth_reset_password
-#. openerp-web
-#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7
-#, python-format
-msgid "Reset password"
-msgstr "重设密码"
diff --git a/addons/auth_reset_password/res_users.py b/addons/auth_reset_password/res_users.py
deleted file mode 100644
index cfac20c76f9..00000000000
--- a/addons/auth_reset_password/res_users.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2012-today OpenERP SA ()
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see
-#
-##############################################################################
-
-from openerp.osv import osv, fields
-from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
-from openerp.tools.translate import _
-
-from datetime import datetime, timedelta
-
-def now(**kwargs):
- dt = datetime.now() + timedelta(**kwargs)
- return dt.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
-
-
-class res_users(osv.osv):
- _inherit = 'res.users'
-
- def reset_password(self, cr, uid, login, context=None):
- """ retrieve the user corresponding to login (login or email),
- and reset their password
- """
- user_ids = self.search(cr, uid, [('login', '=', login)], context=context)
- if not user_ids:
- user_ids = self.search(cr, uid, [('email', '=', login)], context=context)
- if len(user_ids) != 1:
- raise Exception('Reset password: invalid username or email')
- return self.action_reset_password(cr, uid, user_ids, context=context)
-
- def action_reset_password(self, cr, uid, ids, context=None):
- """ create signup token for each user, and send their signup url by email """
- # prepare reset password signup
- res_partner = self.pool.get('res.partner')
- partner_ids = [user.partner_id.id for user in self.browse(cr, uid, ids, context)]
- res_partner.signup_prepare(cr, uid, partner_ids, expiration=now(days=+1), context=context)
-
- # send email to users with their signup url
- template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_reset_password', 'reset_password_email')
- assert template._name == 'email.template'
- for user in self.browse(cr, uid, ids, context):
- if not user.email:
- raise osv.except_osv(_("Cannot send email: user has no email address."), user.name)
- self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
-
- return True
diff --git a/addons/auth_reset_password/res_users_view.xml b/addons/auth_reset_password/res_users_view.xml
deleted file mode 100644
index 628e95b6ff9..00000000000
--- a/addons/auth_reset_password/res_users_view.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
- user.form.reset_password
- res.users
-
-
-
-
-
-
-
-
-
-
- {}
-
-
-
-
-
-
diff --git a/addons/auth_reset_password/static/src/js/reset_password.js b/addons/auth_reset_password/static/src/js/reset_password.js
deleted file mode 100644
index 13fe2a39ce5..00000000000
--- a/addons/auth_reset_password/static/src/js/reset_password.js
+++ /dev/null
@@ -1,30 +0,0 @@
-openerp.auth_reset_password = function(instance) {
- var _t = instance.web._t;
-
- instance.web.Login.include({
- start: function() {
- this.$('a.oe_reset_password').click(this.do_reset_password);
- return this._super();
- },
- do_reset_password: function(ev) {
- if (ev) {
- ev.preventDefault();
- }
- var db = this.$("form [name=db]").val();
- var login = this.$("form input[name=login]").val();
- if (!db) {
- this.do_warn("Login", "No database selected !");
- return false;
- } else if (!login) {
- this.do_warn("Login", "Please enter a username or email address.")
- return false;
- }
- var params = {
- dbname : db,
- login: login,
- };
- var url = "/auth_reset_password/reset_password?" + $.param(params);
- window.location = url;
- }
- });
-};
diff --git a/addons/auth_reset_password/static/src/xml/reset_password.xml b/addons/auth_reset_password/static/src/xml/reset_password.xml
deleted file mode 100644
index 841f3906622..00000000000
--- a/addons/auth_reset_password/static/src/xml/reset_password.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
- Reset password
-
-
-
-
From 699a3323774c81ba38459840116dab795de7420d Mon Sep 17 00:00:00 2001
From: Raphael Collet
Date: Mon, 3 Dec 2012 16:57:57 +0100
Subject: [PATCH 4/4] [IMP] auth_signup: automatically invite new users to set
their password (if they have an email address)
bzr revid: rco@openerp.com-20121203155757-a93sl67rubl3eoov
---
addons/auth_signup/res_users.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index de6ec37a45e..8380cd8b23f 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -249,3 +249,11 @@ class res_users(osv.Model):
self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
return True
+
+ def create(self, cr, uid, values, context=None):
+ # overridden to automatically invite user to sign up
+ user_id = super(res_users, self).create(cr, uid, values, context=context)
+ user = self.browse(cr, uid, user_id, context=context)
+ if user.email:
+ user.action_reset_password()
+ return user_id