diff --git a/signup_with_twilio/README.rst b/signup_with_twilio/README.rst new file mode 100644 index 000000000..a0f76ca11 --- /dev/null +++ b/signup_with_twilio/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +SignUp With Mobile +================== +* This module allow to Signup with Mobile Number + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions ` + +Credits +------- +* Developer: (V16) Busthana Shirin, 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..f023eddc1 --- /dev/null +++ b/signup_with_twilio/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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..08be83096 --- /dev/null +++ b/signup_with_twilio/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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': '16.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': ['auth_signup'], + 'data': [ + 'views/res_config_setting_views.xml', + 'views/signup_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'signup_with_mobile/static/src/css/signup.css', + 'signup_with_mobile/static/src/js/signup.js' + ], + }, + '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..ec5a86f27 --- /dev/null +++ b/signup_with_twilio/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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_mobile diff --git a/signup_with_twilio/controllers/signup_with_mobile.py b/signup_with_twilio/controllers/signup_with_mobile.py new file mode 100644 index 000000000..cd8ff6547 --- /dev/null +++ b/signup_with_twilio/controllers/signup_with_mobile.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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.addons.web.controllers.home import Home +from odoo.http import request +from odoo.exceptions import UserError +from odoo.addons.mail.tools.credentials 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_mobile.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="none") + def web_login(self, **kw): + """Update the parameters to login with mobile Number""" + request.params.update({'login': kw.get('login')}) + return super(AuthSignupHome, self).web_login(redirect=None, **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_mobile.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..a096ce147 --- /dev/null +++ b/signup_with_twilio/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 20.03.2024 +#### Version 16.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..1422c4219 --- /dev/null +++ b/signup_with_twilio/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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..cc446ff6c --- /dev/null +++ b/signup_with_twilio/models/res_config_settings.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-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('Twilio From Number', + help="From number which used to send sms " + "from the number", + config_parameter='signup_with_mobile.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/l1.png b/signup_with_twilio/static/description/assets/modules/l1.png new file mode 100644 index 000000000..ed175b076 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/l1.png differ diff --git a/signup_with_twilio/static/description/assets/modules/l2.png b/signup_with_twilio/static/description/assets/modules/l2.png new file mode 100644 index 000000000..a3194264c Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/l2.png differ diff --git a/signup_with_twilio/static/description/assets/modules/l3.png b/signup_with_twilio/static/description/assets/modules/l3.png new file mode 100644 index 000000000..e894393ef Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/l3.png differ diff --git a/signup_with_twilio/static/description/assets/modules/l4.png b/signup_with_twilio/static/description/assets/modules/l4.png new file mode 100644 index 000000000..f3c986fc1 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/l4.png differ diff --git a/signup_with_twilio/static/description/assets/modules/l5.png b/signup_with_twilio/static/description/assets/modules/l5.png new file mode 100644 index 000000000..b21837312 Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/l5.png differ diff --git a/signup_with_twilio/static/description/assets/modules/l6.png b/signup_with_twilio/static/description/assets/modules/l6.png new file mode 100644 index 000000000..e64a5b55c Binary files /dev/null and b/signup_with_twilio/static/description/assets/modules/l6.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/Screenshot2.png b/signup_with_twilio/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..81876a010 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/Screenshot2.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/Screenshot3.png b/signup_with_twilio/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..e8f1b970e Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/Screenshot3.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/Screenshot4.png b/signup_with_twilio/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..ac62ca0b0 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/Screenshot4.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/Screenshot5.png b/signup_with_twilio/static/description/assets/screenshots/Screenshot5.png new file mode 100644 index 000000000..261e90049 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/Screenshot5.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/Screenshot6.png b/signup_with_twilio/static/description/assets/screenshots/Screenshot6.png new file mode 100644 index 000000000..32e65e2ed Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/Screenshot6.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/Screenshot7.png b/signup_with_twilio/static/description/assets/screenshots/Screenshot7.png new file mode 100644 index 000000000..2ef1ec737 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/Screenshot7.png differ diff --git a/signup_with_twilio/static/description/assets/screenshots/Screenshot8.png b/signup_with_twilio/static/description/assets/screenshots/Screenshot8.png new file mode 100644 index 000000000..bcd47327a Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/Screenshot8.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..fc253cac1 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/hero.gif differ diff --git a/signup_with_twilio/static/description/assets/screenshots/screenshot1.png b/signup_with_twilio/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..1940c18e1 Binary files /dev/null and b/signup_with_twilio/static/description/assets/screenshots/screenshot1.png 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..8e45755c6 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..aa338f653 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..b2e984fbd --- /dev/null +++ b/signup_with_twilio/static/description/index.html @@ -0,0 +1,601 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ SignUp With Mobile +

+

User Can SignUp With Mobile Number.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ User can signup with mobile or email ID, if user signing up with mobile should verify their mobile number also. +
+ +
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + User Can signup with mobile number. +
+
+
+
+ + Signup with Email ID also possible. +
+
+
+
+ + Mobile number should verify by otp for safety. +
+
+
+
+ + Available in both community and enterprise. +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Twilio Configuration

+

Create an Account in Twilio and Create from number which provided by Twilio.

+ +
+ +
+

Update the Credentials in Odoo Settings > Twilio. +

+ +
+ +
+

Signup with Mobile Number +

+

There is a link for signup with mobile number. +

+ +
+ +
+

Firstly add the mobile number and click the sent otp button, + then we will receive a otp in given mobile number, then add the mobile number + in the OTP field and update the name and password, then click on the Signup. +

+ + + + +
+ +
+

Reset Password +

+

If in case we forget the password, reset the password will send mail to the given mail. +

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

+ Related + Products +

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

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ 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 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ + 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..774b51bdf --- /dev/null +++ b/signup_with_twilio/static/src/js/signup.js @@ -0,0 +1,59 @@ +odoo.define('signup_with_mobile.signup', function (require) { +'use strict'; + var rpc = require('web.rpc'); + var ajax = require('web.ajax'); + var publicWidget = require('web.public.widget'); + var SignUpFormExtension = publicWidget.registry.SignUpForm.extend({ + selector: '.oe_signup_form_mobile, .oe_reset_password_form', + events: { + 'click .sent-otp': '_onClick', + 'change .check_login': '_onClickCheck', + 'click button[type="submit"]': '_onSubmitClick', + }, + async willStart() { + this.$('.sign-up').attr('disabled','disabled'); + }, + _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) + ajax.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 + } + }, + }); + publicWidget.registry.SignUpForm = SignUpFormExtension; +}); 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..337ff7611 --- /dev/null +++ b/signup_with_twilio/views/res_config_setting_views.xml @@ -0,0 +1,21 @@ + + + + + + res.config.settings.view.form.inherit.signup.with.mobile + + 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..40eed300d --- /dev/null +++ b/signup_with_twilio/views/signup_templates.xml @@ -0,0 +1,146 @@ + + + + + + + + + + +