diff --git a/signup_with_twilio/README.rst b/signup_with_twilio/README.rst new file mode 100644 index 000000000..b61499421 --- /dev/null +++ b/signup_with_twilio/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +SignUp With Mobile +================== +* This module allow to Signup with Mobile Number + +Configuration +============= +* Install twilio [$ pip install twilio]. + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V16) Busthana Shirin, + (V17) Fathima Mazlin AM, + (V18) ADARSH K, +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/signup_with_twilio/__init__.py b/signup_with_twilio/__init__.py new file mode 100644 index 000000000..ad3674a28 --- /dev/null +++ b/signup_with_twilio/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/signup_with_twilio/__manifest__.py b/signup_with_twilio/__manifest__.py new file mode 100644 index 000000000..bfcf0e14c --- /dev/null +++ b/signup_with_twilio/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'SignUp With Mobile', + 'version': '18.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'A Module For SignUp With Mobile Number.', + 'description': """Module helps users sign up using their mobile number + and verify it with a one-time password (OTP) by Twilio. Additionally, the + option to sign up with an email ID is also available""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['portal', 'auth_signup', 'mail'], + 'data': [ + 'views/res_config_setting_views.xml', + 'views/signup_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'signup_with_twilio/static/src/css/signup.css', + 'signup_with_twilio/static/**/*', + ], + }, + 'external_dependencies': { + 'python': ['twilio'] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/signup_with_twilio/controllers/__init__.py b/signup_with_twilio/controllers/__init__.py new file mode 100644 index 000000000..c97d20657 --- /dev/null +++ b/signup_with_twilio/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import signup_with_twilio diff --git a/signup_with_twilio/controllers/signup_with_twilio.py b/signup_with_twilio/controllers/signup_with_twilio.py new file mode 100644 index 000000000..10e2ff9dd --- /dev/null +++ b/signup_with_twilio/controllers/signup_with_twilio.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import logging +import werkzeug +import werkzeug.exceptions +import werkzeug.utils +import werkzeug.wrappers +import werkzeug.wsgi +from twilio.rest import Client +from odoo import http, _ +from odoo.http import request +from odoo.exceptions import UserError +from odoo.addons.web.controllers.home import Home +from odoo.addons.mail.tools.discuss import get_twilio_credentials +from odoo.addons.auth_signup.models.res_users import SignupError +_logger = logging.getLogger(__name__) + + +class AuthSignupHome(Home): + """Uses to signup with mobile number and + login with the same mobile number""" + + @http.route('/web/signup-mobile', type='http', auth='public', + website=True, sitemap=False) + def web_auth_signup_mobile(self, *args, **kw): + """Create new user with mobile number""" + qcontext = self.get_auth_signup_qcontext() + if kw.get('country_code') and kw.get('login_mobile'): + qcontext.update({'login': kw.get('country_code') + kw.get( + 'login_mobile')}) + kw.update({'login': kw.get('country_code') + kw.get( + 'login_mobile')}) + if not qcontext.get('token') and not qcontext.get('signup_enabled'): + raise werkzeug.exceptions.NotFound() + if 'error' not in qcontext and request.httprequest.method == 'POST': + try: + self.do_signup(qcontext) + user = request.env['res.users'].sudo().search( + [('login', '=', qcontext['login'])]) + if user.partner_id and kw.get('signup_mobile'): + user.partner_id.update({'email': ''}) + user.partner_id.update({'phone': qcontext['login']}) + 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 Mobile Number.") + else: + _logger.error("%s", e) + qcontext['error'] = _("Could not create a new account.") + response = request.render('signup_with_twilio.signup_mobile', qcontext) + response.headers['X-Frame-Options'] = 'SAMEORIGIN' + response.headers['Content-Security-Policy'] = "frame-ancestors 'self'" + return response + + @http.route('/web/login', type='http', auth="public", website=True) + def web_login(self, redirect=None, **kw): + """Update the parameters to login with mobile Number""" + request.params.update({'login': kw.get('login')}) + return super().web_login(**kw) + + @http.route('/web/send_otp', auth='public', type='json') + def web_send_otp(self, **kw): + """Sent OTP through SMS to the given number using twilio""" + (account_sid, auth_token) = get_twilio_credentials(request.env) + from_number = request.env['ir.config_parameter'].sudo().get_param( + 'signup_with_twilio.twilio_from_number') + if not account_sid or not auth_token or not from_number: + raise UserError(_('Twilio Credential are Required')) + client = Client(account_sid, auth_token) + message = client.messages.create( + to='+' + kw.get('country_code') + kw.get('mobile'), + from_=from_number, + body='Your Odoo verification code is:' + str(kw.get('otp')) + + '.OTP valid till 2 minutes.' + ) + _logger.info('Message successfully sent to your mobie number: %s', + message.sid) + + @http.route('/web/reset_password', type='http', auth='public', + website=True, sitemap=False) + def web_auth_reset_password(self, *args, **kw): + """Update the email in user email field""" + if kw.get('login-mail'): + user = request.env['res.users'].sudo().search( + [('login', '=', kw.get('login'))]) + if user: + user.email = kw.get('login-mail') + return super(AuthSignupHome, self).web_auth_reset_password(args, **kw) diff --git a/signup_with_twilio/doc/RELEASE_NOTES.md b/signup_with_twilio/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9538ada91 --- /dev/null +++ b/signup_with_twilio/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 04.10.2024 +#### Version 18.0.1.0.0 +##### ADD +- Initial Commit for SignUp With Mobile diff --git a/signup_with_twilio/models/__init__.py b/signup_with_twilio/models/__init__.py new file mode 100644 index 000000000..2cd12d9b5 --- /dev/null +++ b/signup_with_twilio/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import res_config_settings diff --git a/signup_with_twilio/models/res_config_settings.py b/signup_with_twilio/models/res_config_settings.py new file mode 100644 index 000000000..588e3be04 --- /dev/null +++ b/signup_with_twilio/models/res_config_settings.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + """ Inherit the base settings to add a twilio from number """ + _inherit = 'res.config.settings' + + twilio_from_number = fields.Char( + string='Twilio From Number', help="From number which used to send sms " + "from the number", + config_parameter='signup_with_twilio.twilio_from_number') diff --git a/signup_with_twilio/static/description/assets/cybro-icon.png b/signup_with_twilio/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/signup_with_twilio/static/description/assets/cybro-icon.png differ diff --git a/signup_with_twilio/static/description/assets/cybro-odoo.png b/signup_with_twilio/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/signup_with_twilio/static/description/assets/cybro-odoo.png differ diff --git a/signup_with_twilio/static/description/assets/h2.png b/signup_with_twilio/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/signup_with_twilio/static/description/assets/h2.png differ diff --git a/signup_with_twilio/static/description/assets/icons/arrows-repeat.svg b/signup_with_twilio/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/banner-1.png b/signup_with_twilio/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/banner-1.png differ diff --git a/signup_with_twilio/static/description/assets/icons/banner-2.svg b/signup_with_twilio/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/banner-bg.png b/signup_with_twilio/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/banner-bg.png differ diff --git a/signup_with_twilio/static/description/assets/icons/banner-bg.svg b/signup_with_twilio/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/banner-call.svg b/signup_with_twilio/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/banner-mail.svg b/signup_with_twilio/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/banner-pattern.svg b/signup_with_twilio/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/banner-promo.svg b/signup_with_twilio/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/brand-pair.svg b/signup_with_twilio/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/check.png b/signup_with_twilio/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/check.png differ diff --git a/signup_with_twilio/static/description/assets/icons/chevron.png b/signup_with_twilio/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/chevron.png differ diff --git a/signup_with_twilio/static/description/assets/icons/close-icon.svg b/signup_with_twilio/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/cogs.png b/signup_with_twilio/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/cogs.png differ diff --git a/signup_with_twilio/static/description/assets/icons/collabarate-icon.svg b/signup_with_twilio/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/signup_with_twilio/static/description/assets/icons/consultation.png b/signup_with_twilio/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/consultation.png differ diff --git a/signup_with_twilio/static/description/assets/icons/cybro-logo.png b/signup_with_twilio/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/cybro-logo.png differ diff --git a/signup_with_twilio/static/description/assets/icons/down.svg b/signup_with_twilio/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/signup_with_twilio/static/description/assets/icons/ecom-black.png b/signup_with_twilio/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/ecom-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/education-black.png b/signup_with_twilio/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/education-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/faq.png b/signup_with_twilio/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/faq.png differ diff --git a/signup_with_twilio/static/description/assets/icons/feature-icon.svg b/signup_with_twilio/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/feature.png b/signup_with_twilio/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/feature.png differ diff --git a/signup_with_twilio/static/description/assets/icons/gear.svg b/signup_with_twilio/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/hero.gif b/signup_with_twilio/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..5f17928ef Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/hero.gif differ diff --git a/signup_with_twilio/static/description/assets/icons/hire-odoo.svg b/signup_with_twilio/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/hotel-black.png b/signup_with_twilio/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/hotel-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/license.png b/signup_with_twilio/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/license.png differ diff --git a/signup_with_twilio/static/description/assets/icons/life-ring-icon.svg b/signup_with_twilio/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/lifebuoy.png b/signup_with_twilio/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/lifebuoy.png differ diff --git a/signup_with_twilio/static/description/assets/icons/mail.svg b/signup_with_twilio/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/signup_with_twilio/static/description/assets/icons/manufacturing-black.png b/signup_with_twilio/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/manufacturing-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/notes.png b/signup_with_twilio/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/notes.png differ diff --git a/signup_with_twilio/static/description/assets/icons/notification icon.svg b/signup_with_twilio/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/odoo-consultancy.svg b/signup_with_twilio/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/signup_with_twilio/static/description/assets/icons/odoo-licencing.svg b/signup_with_twilio/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/signup_with_twilio/static/description/assets/icons/odoo-logo.png b/signup_with_twilio/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/odoo-logo.png differ diff --git a/signup_with_twilio/static/description/assets/icons/patter.svg b/signup_with_twilio/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/pattern1.png b/signup_with_twilio/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/pattern1.png differ diff --git a/signup_with_twilio/static/description/assets/icons/pos-black.png b/signup_with_twilio/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/pos-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/puzzle-piece-icon.svg b/signup_with_twilio/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/puzzle.png b/signup_with_twilio/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/puzzle.png differ diff --git a/signup_with_twilio/static/description/assets/icons/replace-icon.svg b/signup_with_twilio/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/restaurant-black.png b/signup_with_twilio/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/restaurant-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/screenshot-main.png b/signup_with_twilio/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/screenshot-main.png differ diff --git a/signup_with_twilio/static/description/assets/icons/screenshot.png b/signup_with_twilio/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/screenshot.png differ diff --git a/signup_with_twilio/static/description/assets/icons/service-black.png b/signup_with_twilio/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/service-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/skype-fill.svg b/signup_with_twilio/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/skype.png b/signup_with_twilio/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/skype.png differ diff --git a/signup_with_twilio/static/description/assets/icons/skype.svg b/signup_with_twilio/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/signup_with_twilio/static/description/assets/icons/star-1.svg b/signup_with_twilio/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/star-2.svg b/signup_with_twilio/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/support.png b/signup_with_twilio/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/support.png differ diff --git a/signup_with_twilio/static/description/assets/icons/test-1 - Copy.png b/signup_with_twilio/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/test-1 - Copy.png differ diff --git a/signup_with_twilio/static/description/assets/icons/test-1.png b/signup_with_twilio/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/test-1.png differ diff --git a/signup_with_twilio/static/description/assets/icons/test-2.png b/signup_with_twilio/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/test-2.png differ diff --git a/signup_with_twilio/static/description/assets/icons/trading-black.png b/signup_with_twilio/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/trading-black.png differ diff --git a/signup_with_twilio/static/description/assets/icons/training.png b/signup_with_twilio/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/training.png differ diff --git a/signup_with_twilio/static/description/assets/icons/translate.svg b/signup_with_twilio/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/update.png b/signup_with_twilio/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/update.png differ diff --git a/signup_with_twilio/static/description/assets/icons/user.png b/signup_with_twilio/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/user.png differ diff --git a/signup_with_twilio/static/description/assets/icons/video.png b/signup_with_twilio/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/video.png differ diff --git a/signup_with_twilio/static/description/assets/icons/whatsapp.png b/signup_with_twilio/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/whatsapp.png differ diff --git a/signup_with_twilio/static/description/assets/icons/wrench-icon.svg b/signup_with_twilio/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/signup_with_twilio/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/signup_with_twilio/static/description/assets/icons/wrench.png b/signup_with_twilio/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/signup_with_twilio/static/description/assets/icons/wrench.png differ diff --git a/signup_with_twilio/static/description/assets/modules/1.gif b/signup_with_twilio/static/description/assets/modules/1.gif new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/1.gif differ diff --git a/signup_with_twilio/static/description/assets/modules/2.gif b/signup_with_twilio/static/description/assets/modules/2.gif new file mode 100644 index 000000000..d19e2b352 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/2.gif differ diff --git a/signup_with_twilio/static/description/assets/modules/3.png b/signup_with_twilio/static/description/assets/modules/3.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/3.png differ diff --git a/signup_with_twilio/static/description/assets/modules/4.png b/signup_with_twilio/static/description/assets/modules/4.png new file mode 100644 index 000000000..3bedf7981 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/4.png differ diff --git a/signup_with_twilio/static/description/assets/modules/5.png b/signup_with_twilio/static/description/assets/modules/5.png new file mode 100644 index 000000000..0e311ca87 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/5.png differ diff --git a/signup_with_twilio/static/description/assets/modules/6.jpg b/signup_with_twilio/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/6.jpg differ diff --git a/signup_with_twilio/static/description/assets/screenshots/ss1.png b/signup_with_twilio/static/description/assets/screenshots/ss1.png new file mode 100644 index 000000000..1114db066 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/ss1.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/ss2.png b/signup_with_twilio/static/description/assets/screenshots/ss2.png new file mode 100644 index 000000000..f62219451 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/ss2.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/ss3.png b/signup_with_twilio/static/description/assets/screenshots/ss3.png new file mode 100644 index 000000000..dc52732be Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/ss3.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/ss4.png b/signup_with_twilio/static/description/assets/screenshots/ss4.png new file mode 100644 index 000000000..37a7102ea Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/ss4.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/ss5.png b/signup_with_twilio/static/description/assets/screenshots/ss5.png new file mode 100644 index 000000000..96dead5ed Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/ss5.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/ss6.png b/signup_with_twilio/static/description/assets/screenshots/ss6.png new file mode 100644 index 000000000..a7a0c48d2 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/ss6.png differ diff --git a/signup_with_twilio/static/description/assets/y18.jpg b/signup_with_twilio/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/signup_with_twilio/static/description/assets/y18.jpg differ diff --git a/signup_with_twilio/static/description/banner.jpg b/signup_with_twilio/static/description/banner.jpg new file mode 100644 index 000000000..e0c71624e Binary files /dev/null and b/signup_with_twilio/static/description/banner.jpg differ diff --git a/signup_with_twilio/static/description/icon.png b/signup_with_twilio/static/description/icon.png new file mode 100644 index 000000000..914052bdc Binary files /dev/null and b/signup_with_twilio/static/description/icon.png differ diff --git a/signup_with_twilio/static/description/index.html b/signup_with_twilio/static/description/index.html new file mode 100644 index 000000000..69281f9d3 --- /dev/null +++ b/signup_with_twilio/static/description/index.html @@ -0,0 +1,1001 @@ + + + + + + SignUp With Mobile + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ + + + +
+
+ +
+
+
+
+

+ To SignUp With Mobile Number. +

+

SignUp With Mobile +

+
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+

Key + Highlights

+
+
+
+
+ +
+
+ User Can Sign Up With Mobile Number. +
+
+
+
+
+
+ +
+
+ Signup with Email ID also possible. +
+
+
+
+
+
+ +
+
+ Mobile number should verify by otp for safety. +
+
+
+
+
+ +
+
+
+ SignUp With Mobile +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Create an + + Account in Twilio +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Update the Credentials in + + Odoo Settings > Use Twilio ICE servers +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Signup with Mobile Number +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Sent OTP Button +

+
+
+

+ Firstly add the mobile number and click the Sent OTP button, then we will receive otp in given mobile number. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Sign up +

+
+
+

+ Add the OTP in the OTP Verification field and update the name and password, then click on the 'Sign up'. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ User can log in with mobile Number +

+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+

+ User Can Sign Up With Mobile Number.

+
+
+
+
+
+
+
+ +
+

+ Signup with Email ID also possible. +

+
+
+
+
+
+
+
+ +
+

+ Mobile number should verify by otp for safety. +

+
+
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+

+ This module allows users to sign up and log in to Odoo using their mobile number instead of an email address, with OTP (One-Time Password) verification through Twilio. +

+
+
+ +
+ +
+

+ If you don’t receive the OTP, check if your mobile number was entered correctly. You can try requesting the OTP again by clicking "Send OTP". If the issue persists, ensure that your Twilio credentials are correctly configured in Odoo. +

+
+
+
+ +
+
+
+
+
+
+ +
+
+

+ Latest Release 18.0.1.0.0 +

+ + 4th October, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + + + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/signup_with_twilio/static/src/css/signup.css b/signup_with_twilio/static/src/css/signup.css new file mode 100644 index 000000000..cc16493ea --- /dev/null +++ b/signup_with_twilio/static/src/css/signup.css @@ -0,0 +1,36 @@ +.signup-link{ + position: relative; + margin-left: 29%; +} +.country-and-mobile-number{ + display: flex; + flex-direction: row; + position: center; +} +.div_code{ + height: 30px; +} +.login_mobile{ + height: 31px; +} +.field-phone col-lg-3 { + width: 200px; /* Adjust the width as needed */ + overflow: hidden; + color: red; +} + +.field-phone col-lg-3 { + height: 150px; /* Adjust the height as needed */ + overflow-y: scroll; +} + + /* Style the options within the custom dropdown */ +.div_code option { + padding: 10px; + } + + .oe_signup_form_mobile{ + max-width: 300px; + position: relative; + margin: 50px auto; + } diff --git a/signup_with_twilio/static/src/js/signup.js b/signup_with_twilio/static/src/js/signup.js new file mode 100644 index 000000000..4c949e271 --- /dev/null +++ b/signup_with_twilio/static/src/js/signup.js @@ -0,0 +1,57 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; +import { rpc } from "@web/core/network/rpc"; + +publicWidget.registry.SignUpFormExtension = publicWidget.Widget.extend({ + selector: '.oe_signup_form_mobile, .oe_reset_password_form', + events: { + 'click .sent-otp': '_onClick', + 'change .check_login': '_onClickCheck', + 'click button[type="submit"]': '_onSubmitClick', + }, + init() { + this._super(...arguments); + }, + _onClick: function (ev) { + /** OTP will be create and collect the to number and redirected + to the twilio function o send the otp, and enable the signup + button to signup the user **/ + ev.stopPropagation(); + ev.preventDefault(); + this.$('.sign-up').removeAttr('disabled'); + this.$('.sent-otp').attr('disabled','disabled'); + const CountryCode = $(".div_code")[0].value + const Mobile = $(".login_mobile")[0].value + let OTP = ''; + var digits = '0123456789'; + for (let i = 0; i < 4; i++ ) { + OTP += digits[Math.floor(Math.random() * 10)]; + } + window.localStorage.setItem("OTP", OTP) + rpc('/web/send_otp', { + 'country_code' : CountryCode, + 'mobile': Mobile, + 'otp': OTP, + }) + }, + _onSubmitClick: function (ev) { + /**Signup button will check the sent and receive otp to block the + user creation if it is not same, and also enable the otp button to + send the sms again **/ + this.$('.sent-otp').removeAttr('disabled'); + let otp_val = $("#sms_otp_verify")[0].value + let OTP = window.localStorage.getItem("OTP") + if (OTP && otp_val && OTP != otp_val){ + ev.preventDefault(); + alert('OTP is not matching'); + } + }, + _onClickCheck: function (ev) { + /**This will update the email page if it has the same login**/ + let checked = $('.check_login')[0].checked + if (checked) { + $('#login_mail')[0].value = $(".field-login")[0].children[1].value + } + }, +}); + diff --git a/signup_with_twilio/views/res_config_setting_views.xml b/signup_with_twilio/views/res_config_setting_views.xml new file mode 100644 index 000000000..a226c9930 --- /dev/null +++ b/signup_with_twilio/views/res_config_setting_views.xml @@ -0,0 +1,19 @@ + + + + + res.config.settings.view.form.inherit.signup.with.twilio + res.config.settings + + + +
+
+
+
+
+
diff --git a/signup_with_twilio/views/signup_templates.xml b/signup_with_twilio/views/signup_templates.xml new file mode 100644 index 000000000..07ddabfb1 --- /dev/null +++ b/signup_with_twilio/views/signup_templates.xml @@ -0,0 +1,146 @@ + + + + + + + + + + +