summaryrefslogtreecommitdiff
path: root/addons/auth_signup/models/res_config_settings.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/auth_signup/models/res_config_settings.py
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/auth_signup/models/res_config_settings.py')
-rw-r--r--addons/auth_signup/models/res_config_settings.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/addons/auth_signup/models/res_config_settings.py b/addons/auth_signup/models/res_config_settings.py
new file mode 100644
index 00000000..b4e62cec
--- /dev/null
+++ b/addons/auth_signup/models/res_config_settings.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from ast import literal_eval
+
+from odoo import api, fields, models
+
+
+class ResConfigSettings(models.TransientModel):
+ _inherit = 'res.config.settings'
+
+ auth_signup_reset_password = fields.Boolean(string='Enable password reset from Login page', config_parameter='auth_signup.reset_password')
+ auth_signup_uninvited = fields.Selection([
+ ('b2b', 'On invitation'),
+ ('b2c', 'Free sign up'),
+ ], string='Customer Account', default='b2b', config_parameter='auth_signup.invitation_scope')
+ auth_signup_template_user_id = fields.Many2one('res.users', string='Template user for new users created through signup',
+ config_parameter='base.template_portal_user_id')
+
+ def open_template_user(self):
+ action = self.env["ir.actions.actions"]._for_xml_id("base.action_res_users")
+ action['res_id'] = literal_eval(self.env['ir.config_parameter'].sudo().get_param('base.template_portal_user_id', 'False'))
+ action['views'] = [[self.env.ref('base.view_users_form').id, 'form']]
+ return action