diff --git a/addons/anonymous/static/src/xml/anonymous.xml b/addons/anonymous/static/src/xml/anonymous.xml
index 4c6d2fcbf54..7429efff458 100644
--- a/addons/anonymous/static/src/xml/anonymous.xml
+++ b/addons/anonymous/static/src/xml/anonymous.xml
@@ -4,10 +4,12 @@
+
+
diff --git a/addons/signup/__init__.py b/addons/signup/__init__.py
new file mode 100644
index 00000000000..f15ba34bf0a
--- /dev/null
+++ b/addons/signup/__init__.py
@@ -0,0 +1,2 @@
+import signup_wizard
+import res_config
diff --git a/addons/signup/__openerp__.py b/addons/signup/__openerp__.py
new file mode 100644
index 00000000000..b927b9526b7
--- /dev/null
+++ b/addons/signup/__openerp__.py
@@ -0,0 +1,23 @@
+{
+ 'name': 'Signup',
+ 'description': 'Allow users to register',
+ 'author': 'OpenERP SA',
+ 'version': '1.0',
+ 'category': 'Tools',
+ 'website': 'http://www.openerp.com',
+ 'installable': True,
+ 'depends': ['anonymous', 'base_setup'],
+ 'data': [
+ 'signup_wizard.xml',
+ 'res_config.xml',
+ ],
+ 'js': [
+ 'static/src/js/signup.js',
+ ],
+ #'css': [
+ # 'static/src/css/reset_password.css',
+ #],
+ 'qweb': [
+ 'static/src/xml/signup.xml',
+ ],
+}
diff --git a/addons/signup/res_config.py b/addons/signup/res_config.py
new file mode 100644
index 00000000000..0c8ab8023d8
--- /dev/null
+++ b/addons/signup/res_config.py
@@ -0,0 +1,19 @@
+from openerp.osv import osv, fields
+
+class ResConfig(osv.TransientModel):
+ _inherit = 'base.config.settings'
+
+ _columns = {
+ 'signup_user_template_id': fields.many2one('res.users', 'Template user for account creation')
+ }
+
+ def get_default_user_tpl(self, cr, uid, fields, context=None):
+ icp = self.pool.get('ir.config_parameter')
+ return {
+ 'signup_user_template_id': icp.get_param(cr, uid, 'signup.user_template_id', 0) or False
+ }
+
+ def set_user_template(self, cr, uid, ids, context=None):
+ config = self.browse(cr, uid, ids[0], context=context)
+ icp = self.pool.get('ir.config_parameter')
+ icp.set_param(cr, uid, 'signup.user_template_id', config.signup_user_template_id.id)
diff --git a/addons/signup/res_config.xml b/addons/signup/res_config.xml
new file mode 100644
index 00000000000..d2c85a33fd5
--- /dev/null
+++ b/addons/signup/res_config.xml
@@ -0,0 +1,16 @@
+
+
+
+ Inherit General Settings
+ base.config.settings
+
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/signup/signup_wizard.py b/addons/signup/signup_wizard.py
new file mode 100644
index 00000000000..939e90aa21d
--- /dev/null
+++ b/addons/signup/signup_wizard.py
@@ -0,0 +1,65 @@
+from functools import partial
+from openerp.osv import osv, fields
+
+class res_users(osv.Model):
+ _inherit = 'res.users'
+
+ _sql_constraints = [
+ ('email_uniq', 'UNIQUE (user_email)', 'You can not have two users with the same email!')
+ ]
+
+
+class signup_wizard(osv.TransientModel):
+ _name = 'signup.wizard'
+ _columns = {
+ 'name': fields.char('Name', size=64),
+ 'email': fields.char('Email', size=64),
+ 'pw': fields.char('Password', size=64),
+ 'cpw': fields.char('Confirm Password', size=64),
+ 'state': fields.selection([(x, x) for x in 'draft done missmatch'.split()], required=True),
+ }
+ _defaults = {
+ 'state': 'draft',
+ }
+
+ def create(self, cr, uid, values, context=None):
+ # NOTE here, invalid values raises exceptions to avoid storing
+ # sensitive data into the database (which then are available to anyone)
+
+ name = values.get('name')
+ email = values.get('email')
+ pw = values.get('pw')
+ cpw = values.get('cpw')
+
+ if pw != cpw:
+ raise osv.except_osv('Error', 'Passwords missmatch')
+
+ Users = self.pool.get('res.users')
+
+ user_template_id = self.pool.get('ir.config_parameter').get_param(cr, uid, 'signup.user_template_id', 0)
+ if user_template_id:
+ func = partial(Users.copy, cr, 1, user_template_id, context=context)
+ else:
+ func = partial(Users.create, cr, 1, context=context)
+
+ func({
+ 'name': name,
+ 'login': email,
+ 'user_email': email,
+ 'password': pw,
+ 'active': True,
+ })
+
+ values = {'state': 'done'}
+ return super(signup_wizard, self).create(cr, uid, values, context)
+
+ def signup(self, cr, uid, ids, context=None):
+ return {
+ 'type': 'ir.actions.client',
+ 'tag': 'login',
+ }
+
+ def onchange_pw(self, cr, uid, ids, pw, cpw, context=None):
+ if pw != cpw:
+ return {'value': {'state': 'missmatch'}}
+ return {'value': {'state': 'draft'}}
diff --git a/addons/signup/signup_wizard.xml b/addons/signup/signup_wizard.xml
new file mode 100644
index 00000000000..ec5095ff474
--- /dev/null
+++ b/addons/signup/signup_wizard.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ signup.wizard.form
+ signup.wizard
+ form
+
+
+
+
+
+
+ Reset Password
+ ir.actions.act_window
+ signup.wizard
+ form
+ form
+ new
+
+
+
+
diff --git a/addons/signup/static/src/js/signup.js b/addons/signup/static/src/js/signup.js
new file mode 100644
index 00000000000..0de6e83424a
--- /dev/null
+++ b/addons/signup/static/src/js/signup.js
@@ -0,0 +1,21 @@
+openerp.signup = function(instance) {
+
+ instance.web.UserMenu.include({
+ start: function() {
+ var self = this;
+ this._super.apply(this, arguments);
+ this.$element.find('a.oe_topbar_signup').click(function() {
+ var p = self.getParent();
+ var am = p.action_manager;
+ am.do_action({
+ type:'ir.actions.act_window',
+ res_model: 'signup.wizard',
+ views: [[false, 'form']],
+ target: 'new',
+ name: 'Sign Up'
+ });
+ });
+ }
+ });
+
+};
diff --git a/addons/signup/static/src/xml/signup.xml b/addons/signup/static/src/xml/signup.xml
new file mode 100644
index 00000000000..c6c7f555ecd
--- /dev/null
+++ b/addons/signup/static/src/xml/signup.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+