@ -0,0 +1,47 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Advance Signup Page |
||||
|
==================== |
||||
|
The user can create the Sign-Up page for their Odoo website using the Odoo Advance Sign Up tool. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configurations needed |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Affero General Public License, Version 3 (AGPL v3) |
||||
|
( https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developers: (V18): Ammu Raj, |
||||
|
Contact: odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import controllers |
||||
|
from . import models |
@ -0,0 +1,51 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
{ |
||||
|
'name': "Advance Signup Page", |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Website', |
||||
|
'summary': "The user can design a more creative and distinctive sign-up page" |
||||
|
"for their Odoo website by using Odoo Advance Sign Up", |
||||
|
'description': "The user may create the Sign-Up page for their Odoo website" |
||||
|
"using the Odoo Advance Sign Up tool. Various dynamic fields" |
||||
|
"can be added by the Odoo admin as needed to the signup" |
||||
|
"form.The website page for signup, login, and password reset" |
||||
|
"can have custom background picture selected by the Odoo" |
||||
|
"admin. Admins may also add content to the login, register," |
||||
|
"and reset password pages from the Odoo backend.", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
'depends': ['website', 'auth_signup'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'views/signup_configuration_views.xml', |
||||
|
'views/signup_fields_views.xml', |
||||
|
'views/auth_signup_templates.xml' |
||||
|
], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import auth_signup |
@ -0,0 +1,141 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
import logging |
||||
|
from werkzeug.urls import url_encode |
||||
|
from odoo import http, _ |
||||
|
from odoo.exceptions import UserError |
||||
|
from odoo.http import request |
||||
|
from odoo.addons.auth_signup.controllers.main import AuthSignupHome |
||||
|
from odoo.addons.auth_signup.models.res_users import SignupError |
||||
|
from odoo.addons.web.controllers.home import ensure_db |
||||
|
|
||||
|
_logger = logging.getLogger(__name__) |
||||
|
|
||||
|
|
||||
|
class AuthSignupHome(AuthSignupHome): |
||||
|
"""Custom AuthSignupHome Controller for Handling Signup.This custom |
||||
|
AuthSignupHome controller extends the default Odoo 'AuthSignupHome' |
||||
|
controller to handle signup functionality.It provides methods for web |
||||
|
login and signup, including additional configuration fields.""" |
||||
|
@http.route() |
||||
|
def web_login(self, *args, **kw): |
||||
|
""" Perform web login.""" |
||||
|
ensure_db() |
||||
|
response = super().web_login(*args, **kw) |
||||
|
response.qcontext.update(self.get_auth_signup_config()) |
||||
|
if request.session.uid: |
||||
|
if request.httprequest.method == 'GET' and request.params.get( |
||||
|
'redirect'): |
||||
|
# Redirect if already logged in and redirect param is present |
||||
|
return request.redirect(request.params.get('redirect')) |
||||
|
# Add message for non-internal user account without redirect |
||||
|
# if account was just created |
||||
|
if response.location == '/web/login_successful' and kw.get( |
||||
|
'confirm_password'): |
||||
|
return request.redirect_query('/web/login_successful', |
||||
|
query={'account_created': True}) |
||||
|
return response |
||||
|
|
||||
|
@http.route('/web/signup', type='http', auth='public', website=True, |
||||
|
sitemap=False) |
||||
|
def web_auth_signup(self, *args, **kw): |
||||
|
"""Overridden the controller function to add the configuration into |
||||
|
the qcontext""" |
||||
|
qcontext = self.get_auth_signup_qcontext() |
||||
|
configuration = request.env['signup.configuration'].sudo(). \ |
||||
|
search([('website_id', '=', request.website.id)], limit=1) |
||||
|
for key in kw: |
||||
|
qcontext[key] = kw[key] |
||||
|
if configuration: |
||||
|
qcontext.update({ |
||||
|
'configuration': configuration |
||||
|
}) |
||||
|
if 'error' not in qcontext and request.httprequest.method == 'POST': |
||||
|
try: |
||||
|
self.do_signup(qcontext) |
||||
|
# Send an account creation confirmation email |
||||
|
user = request.env['res.users'] |
||||
|
user_sudo = user.sudo().search( |
||||
|
user._get_login_domain(qcontext.get('login')), |
||||
|
order=user._get_login_order(), limit=1 |
||||
|
) |
||||
|
template = request.env.ref( |
||||
|
'auth_signup.mail_template_user_signup_account_created', |
||||
|
raise_if_not_found=False) |
||||
|
if user_sudo and template: |
||||
|
template.sudo().send_mail(user_sudo.id, force_send=True) |
||||
|
return self.web_login(*args, **kw) |
||||
|
except UserError as e: |
||||
|
qcontext['error'] = e.args[0] |
||||
|
except (SignupError, AssertionError) as e: |
||||
|
if request.env["res.users"].sudo().search( |
||||
|
[("login", "=", qcontext.get("login"))]): |
||||
|
qcontext["error"] = _( |
||||
|
"Another user is already registered using this email " |
||||
|
"address.") |
||||
|
else: |
||||
|
_logger.error("%s", e) |
||||
|
qcontext['error'] = _("Could not create a new account.") |
||||
|
elif 'signup_email' in qcontext: |
||||
|
user = request.env['res.users'].sudo().search( |
||||
|
[('email', '=', qcontext.get('signup_email')), |
||||
|
('state', '!=', 'new')], limit=1) |
||||
|
if user: |
||||
|
return request.redirect('/web/login?%s' % url_encode( |
||||
|
{'login': user.login, 'redirect': '/web'})) |
||||
|
response = request.render('auth_signup.signup', qcontext) |
||||
|
response.headers['X-Frame-Options'] = 'SAMEORIGIN' |
||||
|
response.headers['Content-Security-Policy'] = "frame-ancestors 'self'" |
||||
|
return response |
||||
|
|
||||
|
def _prepare_signup_values(self, qcontext): |
||||
|
"""Updated the values with newly added fields""" |
||||
|
keys = ['login', 'name', 'password'] |
||||
|
configuration = request.env['signup.configuration'] \ |
||||
|
.sudo().search([], limit=1) |
||||
|
for field in configuration.signup_field_ids: |
||||
|
keys.append(field.field_id.name) |
||||
|
values = {key: qcontext.get(key) for key in keys} |
||||
|
if not values: |
||||
|
raise UserError(_("The form was not properly filled in.")) |
||||
|
if values.get('password') != qcontext.get('confirm_password'): |
||||
|
raise UserError(_("Passwords do not match; please retype them.")) |
||||
|
supported_lang_codes = [code for code, _ in |
||||
|
request.env['res.lang'].sudo().get_installed()] |
||||
|
lang = request.context.get('lang', '') |
||||
|
if lang in supported_lang_codes: |
||||
|
values['lang'] = lang |
||||
|
return values |
||||
|
|
||||
|
@http.route('/web/signup', type='http', auth="public", website=True, |
||||
|
sitemap=False) |
||||
|
def website_signup(self): |
||||
|
"""Perform website signup.""" |
||||
|
values = {} |
||||
|
configuration_signup = request.env[ |
||||
|
'configuration.signup'].sudo().search([], limit=1) |
||||
|
if configuration_signup.is_show_terms_conditions: |
||||
|
values[ |
||||
|
'terms_and_conditions'] = configuration_signup \ |
||||
|
.terms_and_conditions |
||||
|
return request.render( |
||||
|
"advance_signup_portal.advance_signup_portal.fields", values) |
@ -0,0 +1,6 @@ |
|||||
|
## Module <advance_signup_page> |
||||
|
|
||||
|
#### 02.12.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial Commit for Advance Signup Page |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import signup_configuration |
||||
|
from . import signup_field |
@ -0,0 +1,64 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class SignupConfiguration(models.Model): |
||||
|
"""Model for Signup Configuration.This class represents the Signup |
||||
|
Configuration model for the Odoo website.It is used to configure the |
||||
|
signup page, including defining fields, content,and other settings.""" |
||||
|
_name = 'signup.configuration' |
||||
|
_description = 'Signup Configuration' |
||||
|
_sql_constraints = [('website_id', 'unique(website_id)', |
||||
|
'A record for this website is already exist')] |
||||
|
|
||||
|
name = fields.Char(string='Name', copy=False, required=True, |
||||
|
help='The name of the signup configuration.') |
||||
|
website_id = fields.Many2one(comodel_name='website', |
||||
|
string='Website', required=True, |
||||
|
help='The website associated with the signup' |
||||
|
' configuration.') |
||||
|
is_active = fields.Boolean(string='Active', default=True, |
||||
|
help='Specifies if the signup configuration is ' |
||||
|
'active or not.') |
||||
|
signup_field_ids = fields.One2many(comodel_name='signup.field', |
||||
|
inverse_name='configuration_id', |
||||
|
string='Signup Fields', |
||||
|
help='The fields associated with the ' |
||||
|
'signup configuration.') |
||||
|
signup_page_content = fields.Html(string='Signup Page Content', |
||||
|
help='The content of the signup page.') |
||||
|
login_page_content = fields.Html(string='Login Page Content', |
||||
|
help='The content of the login page.') |
||||
|
reset_password_content = fields.Html(string='Reset Password Content', |
||||
|
help='The content of the reset' |
||||
|
' password page.') |
||||
|
background_image = fields.Binary(string='Background Image', |
||||
|
help='The background image for the ' |
||||
|
'signup page.') |
||||
|
is_show_terms_conditions = fields.Boolean( |
||||
|
string='Show Terms and Condition in Signup Page', |
||||
|
help='Specifies if the terms and conditions ' |
||||
|
'should be shown on the signup page.') |
||||
|
terms_and_conditions = fields.Html(string='Terms and Conditions', |
||||
|
help='The terms and conditions' |
||||
|
' text for the signup page.') |
@ -0,0 +1,87 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class SignupFields(models.Model): |
||||
|
""" Model for Signup Fields.This class represents the Signup Fields model |
||||
|
for the Odoo website. It is used to define and manage the fields that |
||||
|
users can sign up with.""" |
||||
|
_name = 'signup.field' |
||||
|
_description = 'Signup Fields for Website' |
||||
|
|
||||
|
field_id = fields.Many2one(comodel_name='ir.model.fields', |
||||
|
string='Signup Field', |
||||
|
domain=[('model_id.model', '=', 'res.users'), |
||||
|
('ttype', 'in', ['char', 'integer', |
||||
|
'float', 'text', 'date', |
||||
|
'datetime', |
||||
|
'binary', 'boolean'])], |
||||
|
help='The field associated with the ' |
||||
|
'signup field.') |
||||
|
name = fields.Char(string='Field Label', |
||||
|
related='field_id.field_description', |
||||
|
help='The label of the signup field.') |
||||
|
placeholder = fields.Char(string='Placeholder', |
||||
|
help='The placeholder text for the ' |
||||
|
'signup field.') |
||||
|
help_description = fields.Text(string='Help', |
||||
|
help='Additional help or description ' |
||||
|
'for the signup field.') |
||||
|
field_type = fields.Char(string='Field Type', |
||||
|
readonly=True, |
||||
|
help='The type of the signup field.') |
||||
|
number_of_cols = fields.Selection(selection=[('2', '2'), ('3', '3'), |
||||
|
('4', '4'), ('6', '6'), |
||||
|
('12', '12')], |
||||
|
string='Number of Columns', |
||||
|
help='The number of columns for the ' |
||||
|
'signup field layout.') |
||||
|
is_required = fields.Boolean(string='Is Required', |
||||
|
help='Specifies if the signup field is ' |
||||
|
'required.') |
||||
|
configuration_id = fields.Many2one(comodel_name='signup.configuration', |
||||
|
help='The signup configuration ' |
||||
|
'associated with the signup field') |
||||
|
|
||||
|
@api.model_create_multi |
||||
|
def create(self, vals_list): |
||||
|
"""Create records for the SignupFields model.""" |
||||
|
field_ids = [vals['field_id'] for vals in vals_list if |
||||
|
'field_id' in vals] |
||||
|
field_types = self.env['ir.model.fields'].browse(field_ids).mapped( |
||||
|
'ttype') |
||||
|
for vals in vals_list: |
||||
|
if 'field_id' in vals: |
||||
|
vals['field_type'] = field_types[ |
||||
|
field_ids.index(vals['field_id'])] |
||||
|
records = super(SignupFields, self).create( |
||||
|
[vals for vals in vals_list if 'field_id' in vals]) |
||||
|
return records |
||||
|
|
||||
|
def write(self, vals): |
||||
|
"""Override the function to update the field type while saving the |
||||
|
record""" |
||||
|
if 'field_id' in vals: |
||||
|
vals['field_type'] = self.env['ir.model.fields'].browse( |
||||
|
vals['field_id']).ttype |
||||
|
return super(SignupFields, self).write(vals) |
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 432 KiB |
After Width: | Height: | Size: 314 KiB |
After Width: | Height: | Size: 503 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 726 KiB |
After Width: | Height: | Size: 42 KiB |
@ -0,0 +1,180 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<odoo> |
||||
|
<!-- Frontend Layout Extension --> |
||||
|
<template id="frontend_layout_extension" name="Frontend Layout" |
||||
|
inherit_id="web.frontend_layout"> |
||||
|
<xpath expr="//div[@id='wrapwrap']/main" position="attributes"> |
||||
|
<!-- Add a background image style based on the signup configuration --> |
||||
|
<attribute name="t-attf-style" |
||||
|
add="background-image: url('data:image/*;base64,{{request.env['signup.configuration'].sudo().search([('website_id', '=', request.website.id)],limit=1).background_image}}'); background-size: 100% 100%;"/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
<!-- Auth Signup/ResetPassword Form Fields --> |
||||
|
<template id="advance_signup_portal_fields" |
||||
|
inherit_id="auth_signup.fields" |
||||
|
name="Auth Signup/ResetPassword form fields"> |
||||
|
<xpath expr="//div[hasclass('field-confirm_password')]" |
||||
|
position="after"> |
||||
|
<t t-foreach="configuration.signup_field_ids" t-as="field"> |
||||
|
<t t-if="field.field_type in ['char', 'text']"> |
||||
|
<div class="mb-3 field-test pt-2"> |
||||
|
<label> |
||||
|
<t t-esc="field.name"/> |
||||
|
</label> |
||||
|
<input type="text" |
||||
|
t-attf-name="{{field.field_id.name}}" |
||||
|
t-attf-id="{{field.field_id.id}}" |
||||
|
t-attf-class="form-control form-control-sm" |
||||
|
required="required"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
<t t-elif="field.field_type == 'boolean'"> |
||||
|
<div class="mb-3 field-test pt-2"> |
||||
|
<input type="checkbox" |
||||
|
class="form-check-input" |
||||
|
id="webBoolField" |
||||
|
t-att-name="field.field_id.id"/> |
||||
|
<span class="ms-2 text-break" |
||||
|
t-field='field.field_id.name'/> |
||||
|
</div> |
||||
|
</t> |
||||
|
<t t-elif="field.field_type in ['date', 'datetime']"> |
||||
|
<div class="mb-3 field-test pt-2"> |
||||
|
<label> |
||||
|
<t t-esc="field.name"/> |
||||
|
</label> |
||||
|
<input type="date" |
||||
|
t-att-name="field.field_id.name" |
||||
|
t-attf-class="form-control form-control-sm"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
<t t-elif="field.field_type =='binary'"> |
||||
|
<div class="mb-3 field-test pt-2"> |
||||
|
<label> |
||||
|
<t t-esc="field.name"/> |
||||
|
</label> |
||||
|
<input type="file" id="img_field" |
||||
|
class="field_input" |
||||
|
name="img_field" |
||||
|
accept="image/*"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
<t t-elif="field.field_type in ['integer', 'float']"> |
||||
|
<div class="mb-3 field-test pt-2"> |
||||
|
<label> |
||||
|
<t t-esc="field.name"/> |
||||
|
</label> |
||||
|
<input type="number" |
||||
|
t-attf-class="form-control form-control-sm" |
||||
|
t-att-name="field.field_id.name"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
<!-- Display terms and conditions from the configuration --> |
||||
|
<t t-if="configuration.is_show_terms_conditions"> |
||||
|
<div class="form-group"> |
||||
|
<input type="checkbox" name="accept_terms">I Agree to the |
||||
|
<t t-out="configuration.terms_and_conditions"/> |
||||
|
</input> |
||||
|
</div> |
||||
|
</t> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
<!-- Template for Sign Up Form --> |
||||
|
<template id="auth_signup_signup" name="Sign up login"> |
||||
|
<t t-call="web.login_layout"> |
||||
|
<form class="oe_signup_form" role="form" method="post" |
||||
|
t-if="not message"> |
||||
|
<input type="hidden" name="csrf_token" |
||||
|
t-att-value="request.csrf_token()"/> |
||||
|
<t t-call="auth_signup.fields"> |
||||
|
<t t-set="only_passwords" |
||||
|
t-value="bool(token and not invalid_token)"/> |
||||
|
</t> |
||||
|
<p class="alert alert-danger" t-if="error" role="alert"> |
||||
|
<t t-esc="error"/> |
||||
|
</p> |
||||
|
<input type="hidden" name="redirect" t-att-value="redirect"/> |
||||
|
<input type="hidden" name="token" t-att-value="token"/> |
||||
|
<div class="text-center oe_login_buttons d-grid pt-3"> |
||||
|
<button type="submit" class="btn btn-primary">Sign up |
||||
|
</button> |
||||
|
<a t-attf-href="/web/login?{{ keep_query() }}" |
||||
|
class="btn btn-link btn-sm" role="button">Already |
||||
|
have an account? |
||||
|
</a> |
||||
|
<div class="o_login_auth"/> |
||||
|
</div> |
||||
|
</form> |
||||
|
</t> |
||||
|
</template> |
||||
|
<!-- Template for Sign Up Form --> |
||||
|
<template id="advance_signup_portal_signup" |
||||
|
inherit_id="auth_signup.signup" name="Signup Form"> |
||||
|
<form class="oe_signup_form" position="attributes"> |
||||
|
<attribute name="style" |
||||
|
add="z-index: 99;background: #f0f8ff70;padding: 20px;border-radius: 5px;max-width:350px;"/> |
||||
|
</form> |
||||
|
<xpath expr="//input[@name='csrf_token']" position="before"> |
||||
|
<t t-set="configuration" |
||||
|
t-value="request.env['signup.configuration'].sudo().search([('website_id', '=', request.website.id)],limit=1)"/> |
||||
|
<div class="mb-3"> |
||||
|
<span style="font-size: 19px;font-family: sans serif;"> |
||||
|
<b>CREATE YOUR ACCOUNT</b> |
||||
|
</span> |
||||
|
</div> |
||||
|
<div class="mb-4"> |
||||
|
<span style="font-size: 15px;font-family: cursive;font-weight: bold;"> |
||||
|
<t t-esc="configuration.signup_page_content"/> |
||||
|
</span> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
<xpath expr="//form[@class='oe_signup_form']" position="inside"> |
||||
|
<div class="text-center small mt-4 pt-3 border-top" |
||||
|
t-if="not disable_footer"> |
||||
|
<t t-if="not disable_database_manager"> |
||||
|
<a class="border-end pe-2 me-1" |
||||
|
href="/web/database/manager">Manage Databases |
||||
|
</a> |
||||
|
</t> |
||||
|
<a href="https://www.odoo.com?utm_source=db&utm_medium=auth" |
||||
|
target="_blank">Powered by |
||||
|
<span>Odoo</span> |
||||
|
</a> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
<!-- Template for Reset Password Form --> |
||||
|
<template id="advance_signup_portal_reset_password" |
||||
|
inherit_id="auth_signup.reset_password" |
||||
|
name="Reset Password Form"> |
||||
|
<xpath expr="//input[@name='csrf_token']" position="before"> |
||||
|
<t t-set="configuration" |
||||
|
t-value="request.env['signup.configuration'].sudo().search([('website_id', '=', request.website.id)],limit=1)"/> |
||||
|
<div class="mb-3"> |
||||
|
<span style="font-size: 19px;font-family: sans serif;"> |
||||
|
<b>FORGOT YOUR PASSWORD ?</b> |
||||
|
</span> |
||||
|
</div> |
||||
|
<div class="mb-4"> |
||||
|
<span style="font-size: 15px;font-family: cursive;font-weight: bold;"> |
||||
|
<t t-esc="configuration.reset_password_content"/> |
||||
|
</span> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
<form class="oe_reset_password_form" position="attributes"> |
||||
|
<attribute name="style" |
||||
|
add="z-index: 99;background: #f0f8ff70;padding: 20px;border-radius: 5px;max-width:350px;"/> |
||||
|
</form> |
||||
|
</template> |
||||
|
<!-- Template for the Home Page Layout --> |
||||
|
<template id="advance_signup_portal_layout" name="Home" |
||||
|
inherit_id="website.layout"> |
||||
|
<xpath expr="//header" position="attributes"> |
||||
|
<attribute name="t-if">not hide_header</attribute> |
||||
|
</xpath> |
||||
|
<xpath expr="//footer" position="attributes"> |
||||
|
<attribute name="t-if">not hide_footer</attribute> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,82 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- List View for Signup Configuration --> |
||||
|
<record id="signup_configuration_view_list" model="ir.ui.view"> |
||||
|
<field name="name">signup.configuration.view.list</field> |
||||
|
<field name="model">signup.configuration</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<list string="Signup Configuration"> |
||||
|
<field name="name"/> |
||||
|
<field name="website_id"/> |
||||
|
</list> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Form View for Signup Configuration --> |
||||
|
<record id="signup_configuration_view_form" model="ir.ui.view"> |
||||
|
<field name="name">signup.configuration.view.form</field> |
||||
|
<field name="model">signup.configuration</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Signup Configuration"> |
||||
|
<sheet> |
||||
|
<field name="is_active" invisible="1"/> |
||||
|
<div class="oe_title"> |
||||
|
<label for="name"/> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
</div> |
||||
|
<group> |
||||
|
<field name="website_id"/> |
||||
|
</group> |
||||
|
<notebook> |
||||
|
<!-- Page for Signup Fields --> |
||||
|
<page string="Signup Fields" name="signup_fields"> |
||||
|
<field name="signup_field_ids"/> |
||||
|
</page> |
||||
|
<!-- Page for Content Settings --> |
||||
|
<page string="Content Settings" |
||||
|
name="content_settings"> |
||||
|
<group> |
||||
|
<field name="signup_page_content"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="login_page_content"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="reset_password_content"/> |
||||
|
</group> |
||||
|
</page> |
||||
|
<!-- Page for Background Settings --> |
||||
|
<page string="Background Settings" |
||||
|
name="background_settings"> |
||||
|
<group> |
||||
|
<field name="background_image" widget="image"/> |
||||
|
</group> |
||||
|
</page> |
||||
|
<!-- Page for Other Settings --> |
||||
|
<page string="Other Settings" name="other_settings"> |
||||
|
<group> |
||||
|
<field name="is_show_terms_conditions"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="terms_and_conditions" |
||||
|
invisible="is_show_terms_conditions != True"/> |
||||
|
</group> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Action to Open Signup Configuration --> |
||||
|
<record id="signup_configuration_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Signup Configuration</field> |
||||
|
<field name="res_model">signup.configuration</field> |
||||
|
<field name="view_mode">list,form</field> |
||||
|
</record> |
||||
|
<!-- Menu Item for Signup Configuration --> |
||||
|
<menuitem id="signup_configuration_menu" name="Signup Configuration" |
||||
|
parent="website.menu_website_global_configuration" |
||||
|
action="signup_configuration_action" |
||||
|
/> |
||||
|
</odoo> |
@ -0,0 +1,45 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!--Record for the List View of Signup Fields. This view displays a list of signup |
||||
|
fields with their ID, type, and requirement status.--> |
||||
|
<record id="signup_field_view_list" model="ir.ui.view"> |
||||
|
<field name="name">signup.field.view.list</field> |
||||
|
<field name="model">signup.field</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<list string="Signup Fields" name="list_signup_fields"> |
||||
|
<!-- Columns to display in the list view --> |
||||
|
<field name="field_id"/> |
||||
|
<field name="field_type"/> |
||||
|
<field name="is_required"/> |
||||
|
</list> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!--Record for the Form View of Signup Fields.This view provides a detailed |
||||
|
form for managing signup field properties. --> |
||||
|
<record id="signup_field_view_form" model="ir.ui.view"> |
||||
|
<field name="name">signup.field.view.form</field> |
||||
|
<field name="model">signup.field</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Signup Fields" name="form_signup_fields"> |
||||
|
<sheet> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="field_id" |
||||
|
options="{'no_create': True, 'no_create_edit':True}"/> |
||||
|
<field name="name"/> |
||||
|
<field name="placeholder"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="field_type"/> |
||||
|
<field name="number_of_cols"/> |
||||
|
<field name="is_required"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="help_description"/> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |