diff --git a/signup_with_twilio/README.rst b/signup_with_twilio/README.rst new file mode 100644 index 000000000..c35b61863 --- /dev/null +++ b/signup_with_twilio/README.rst @@ -0,0 +1,47 @@ +.. 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, +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..3162388dc --- /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': '17.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..b50ab4ff0 --- /dev/null +++ b/signup_with_twilio/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.04.2024 +#### Version 17.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/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/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/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/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/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/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/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/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.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/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/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/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/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/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/misc/categories.png b/signup_with_twilio/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/categories.png differ diff --git a/signup_with_twilio/static/description/assets/misc/check-box.png b/signup_with_twilio/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/check-box.png differ diff --git a/signup_with_twilio/static/description/assets/misc/compass.png b/signup_with_twilio/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/compass.png differ diff --git a/signup_with_twilio/static/description/assets/misc/corporate.png b/signup_with_twilio/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/corporate.png differ diff --git a/signup_with_twilio/static/description/assets/misc/customer-support.png b/signup_with_twilio/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/customer-support.png differ diff --git a/signup_with_twilio/static/description/assets/misc/cybrosys-logo.png b/signup_with_twilio/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/cybrosys-logo.png differ diff --git a/signup_with_twilio/static/description/assets/misc/features.png b/signup_with_twilio/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/features.png differ diff --git a/signup_with_twilio/static/description/assets/misc/logo.png b/signup_with_twilio/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/logo.png differ diff --git a/signup_with_twilio/static/description/assets/misc/pictures.png b/signup_with_twilio/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/pictures.png differ diff --git a/signup_with_twilio/static/description/assets/misc/pie-chart.png b/signup_with_twilio/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/pie-chart.png differ diff --git a/signup_with_twilio/static/description/assets/misc/right-arrow.png b/signup_with_twilio/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/right-arrow.png differ diff --git a/signup_with_twilio/static/description/assets/misc/star.png b/signup_with_twilio/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/star.png differ diff --git a/signup_with_twilio/static/description/assets/misc/support.png b/signup_with_twilio/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/support.png differ diff --git a/signup_with_twilio/static/description/assets/misc/whatsapp.png b/signup_with_twilio/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/signup_with_twilio/static/description/assets/misc/whatsapp.png differ diff --git a/signup_with_twilio/static/description/assets/modules/1.png b/signup_with_twilio/static/description/assets/modules/1.png new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/1.png differ diff --git a/signup_with_twilio/static/description/assets/modules/2.png b/signup_with_twilio/static/description/assets/modules/2.png new file mode 100644 index 000000000..d6b1fe049 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/2.png 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..5141a7802 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..469963f22 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.png b/signup_with_twilio/static/description/assets/modules/6.png new file mode 100644 index 000000000..7cdd530f0 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/6.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/1.png b/signup_with_twilio/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..a59ea1a0b Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/1.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/2.png b/signup_with_twilio/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..06fe2d671 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/2.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/3.png b/signup_with_twilio/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..59d0c885b Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/3.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/4.png b/signup_with_twilio/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..27b7fa302 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/4.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/5.png b/signup_with_twilio/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..f32a6a369 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/5.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/6.png b/signup_with_twilio/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..0a66e6dcb Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/6.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/hero.gif b/signup_with_twilio/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..489d6526f Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/hero.gif 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..50be20f04 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..1cc982c3b 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..17a971f91 --- /dev/null +++ b/signup_with_twilio/static/description/index.html @@ -0,0 +1,733 @@ + + + + + + + SignUp With Mobile + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ SignUp With Mobile

+

+ To SignUp With Mobile Number +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ User Can Sign Up With Mobile Number. +

+
+
+
+
+
+
+ +
+
+

+ Signup with Email ID also possible.

+
+
+
+
+
+ +
+
+

+ Mobile number should verify by otp for safety.

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

+ Create an Account in Twilio. +

+
+
+
+
+
+
+ +
+
+

+ Update the Credentials in Odoo Settings > Twilio.

+
+
+
+
+
+
+ +
+
+

+ Signup with Mobile Number

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

+ 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. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:25 March 2024 +
+

+ Initial commit for Textile Management

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce + & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + 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..3733f32a8 --- /dev/null +++ b/signup_with_twilio/static/src/js/signup.js @@ -0,0 +1,58 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; +import { jsonrpc } from "@web/core/network/rpc_service"; + +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); + this.rpc = this.bindService("rpc"); + }, + _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) + this.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 @@ + + + + + + + + + + +