@ -0,0 +1,48 @@ |
|||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
|||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Customize Signup |
|||
================ |
|||
This odoo app is helpful if you need to customize the signup page with extra information. |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configurations needed |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (AGPL v3). |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developers: (V18) Sreerag PM |
|||
* Developers: (V17) Bhagyadev KP |
|||
* Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Sreerag PM (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from . import controllers |
@ -0,0 +1,49 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Sreerag PM (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
{ |
|||
'name': 'Customize Signup', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Website', |
|||
'summary': """This odoo app is helpful if you need to customize the signup |
|||
page.""", |
|||
'description': """This app helps to add extra information to the signup |
|||
page, hence it will be more convenient.""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['auth_signup'], |
|||
'data': [ |
|||
'views/signup_template.xml', |
|||
], |
|||
'assets': { |
|||
'web.assets_frontend': [ |
|||
'customize_signup/static/src/css/customize_signup.css', |
|||
'customize_signup/static/src/js/SignUpForm.js', |
|||
], |
|||
}, |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Sreerag PM (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from . import customize_signup |
@ -0,0 +1,55 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Sreerag PM (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
import base64 |
|||
from odoo import http |
|||
from odoo.addons.auth_signup.controllers.main import AuthSignupHome |
|||
from odoo.http import request |
|||
|
|||
|
|||
class WebAuthSignup(AuthSignupHome): |
|||
"""This class helps to set extra information in signup.""" |
|||
|
|||
@http.route('/web/signup', type='http', auth='public', website=True, |
|||
sitemap=False, csrf=False) |
|||
def web_auth_signup(self, *args, **kw): |
|||
""" function used to add extra information at the time of signup """ |
|||
res = super().web_auth_signup(*args, **kw) |
|||
qcontext = self.get_auth_signup_qcontext() |
|||
user = request.env['res.users'] |
|||
user_sudo = user.sudo().search( |
|||
user._get_login_domain(qcontext.get('login')), |
|||
order=user._get_login_order(), limit=1) |
|||
if 'file' in kw: |
|||
data_b64 = kw['file'] |
|||
data = base64.b64encode(data_b64.read()) if data_b64 else b'' |
|||
user_sudo.partner_id.image_1920 = data |
|||
if 'phone' in kw: |
|||
user_sudo.partner_id.phone = kw['phone'] |
|||
if 'job_position' in kw: |
|||
user_sudo.partner_id.function = kw['job_position'] |
|||
if 'city' in kw: |
|||
user_sudo.partner_id.city = kw['city'] |
|||
if 'country' in kw: |
|||
country = request.env['res.country'].search( |
|||
[('id', '=', kw['country'])]) |
|||
user_sudo.partner_id.country_id = country |
|||
return res |
@ -0,0 +1,6 @@ |
|||
## Module <customize_signup> |
|||
|
|||
#### 16.01.2025 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
- Initial Commit for Customize Signup |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 710 KiB |
After Width: | Height: | Size: 776 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 463 KiB |
After Width: | Height: | Size: 622 KiB |
After Width: | Height: | Size: 447 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 115 KiB |
After Width: | Height: | Size: 597 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 699 KiB |
After Width: | Height: | Size: 43 KiB |
@ -0,0 +1,10 @@ |
|||
.information { |
|||
display: none; |
|||
} |
|||
#info { |
|||
margin-left: 76px; |
|||
} |
|||
#hide_info { |
|||
display:none; |
|||
margin-left: -43px; |
|||
} |
@ -0,0 +1,98 @@ |
|||
/** @odoo-module **/ |
|||
import publicWidget from "@web/legacy/js/public/public_widget"; |
|||
import { Dialog } from "@web/core/dialog/dialog"; |
|||
import { _t } from "@web/core/l10n/translation"; |
|||
|
|||
|
|||
publicWidget.registry.SignUpForm = publicWidget.Widget.extend({ |
|||
selector: '.oe_signup_form', |
|||
events: { |
|||
'click #info': '_extraInfo', |
|||
'click #hide_info': '_hideInfo', |
|||
'click .btn-primary':'_signupBtn', |
|||
"input #phone": "validateNumber", |
|||
'change #file': 'validateImageFile', |
|||
}, |
|||
/** |
|||
* this method is used to store the information in the local storage |
|||
*/ |
|||
init() { |
|||
this._super.apply(this, arguments); |
|||
this.notification = this.bindService("notification"); |
|||
}, |
|||
start: function(){ |
|||
if (localStorage.getItem('city')){ |
|||
this.$el.find('#city').val(localStorage.getItem('city')) |
|||
} |
|||
this.$el.find('#job_position').val(localStorage.getItem('job_position')) |
|||
this.$el.find('#phone').val(localStorage.getItem('phone')) |
|||
this.$el.find('#country').val(localStorage.getItem('country')) |
|||
}, |
|||
/** |
|||
* Removes stored data from localStorage related to user signup information. |
|||
*/ |
|||
_signupBtn:function (){ |
|||
localStorage.removeItem('city') |
|||
localStorage.removeItem('job_position') |
|||
localStorage.removeItem('phone') |
|||
localStorage.removeItem('country'); |
|||
}, |
|||
/** |
|||
* this method is used to show the extra information given in the |
|||
* signup form |
|||
*/ |
|||
_extraInfo: function () { |
|||
this.$el.find("#data").toggle(); |
|||
if (info.style.display == 'none') { |
|||
info.style.display = 'block'; |
|||
} else { |
|||
info.style.display = 'none'; |
|||
hide_info.style.display = 'block'; |
|||
} |
|||
}, |
|||
/** |
|||
* this method is used to hide the extra information given in the |
|||
* signup form |
|||
*/ |
|||
_hideInfo: function () { |
|||
this.$el.find("#data").toggle(); |
|||
if (hide_info.style.display == 'none') { |
|||
hide_info.style.display = 'block'; |
|||
} else { |
|||
hide_info.style.display = 'none'; |
|||
info.style.marginLeft= '-37px', info.style.display = 'block'; |
|||
} |
|||
}, |
|||
/** |
|||
* this method is used to validate phone number field given in the |
|||
* signup form |
|||
*/ |
|||
validateNumber: function (ev) { |
|||
const input = this.$(ev.currentTarget); |
|||
const inputValue = input.val(); |
|||
if (inputValue.length > 0) { |
|||
if (!/^\d+$/.test(inputValue)) { |
|||
input.val(''); // Clear the field
|
|||
this.notification.add(_t("Enter a valid number"), { type: 'danger', }); |
|||
} |
|||
} |
|||
return; |
|||
}, |
|||
/** |
|||
* this method is used to validate File field given in the |
|||
* signup form |
|||
*/ |
|||
validateImageFile: function (ev) { |
|||
const fileInput = this.$(ev.currentTarget); |
|||
const file = fileInput[0].files[0]; |
|||
|
|||
if (file) { |
|||
const allowedExtensions = /(\.jpg|\.jpeg|\.png|\.gif)$/i; |
|||
if (!allowedExtensions.exec(file.name)) { |
|||
fileInput.val(''); |
|||
this.notification.add(_t("Enter a valid image file"), { type: 'danger', }); |
|||
} |
|||
} |
|||
return; |
|||
} |
|||
}); |
@ -0,0 +1,49 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<template id="signup_template" inherit_id="auth_signup.fields"> |
|||
<xpath expr="//div[hasclass('field-confirm_password')]" position="after"> |
|||
<!-- Added extra information in the signup page --> |
|||
<div class="information" id="data"> |
|||
<div class="mb-3 field-phone"> |
|||
<label for="phone">Phone</label> |
|||
<input type="text" class="form-control form-control-sm" |
|||
name="phone" id="phone"/> |
|||
</div> |
|||
<div class="mb-3 field-city"> |
|||
<label for="city">City</label> |
|||
<input type="text" class="form-control form-control-sm" |
|||
name="city" id="city"/> |
|||
<br/> |
|||
</div> |
|||
<div class="mb-3 field-job-position"> |
|||
<label for="job_position">Job Position</label> |
|||
<input type="text" class="form-control form-control-sm" |
|||
name="job_position" id="job_position"/> |
|||
<br/> |
|||
</div> |
|||
<label for="file">File</label> |
|||
<input type="file" class="o_input_file" id="file" name="file"/> |
|||
<label for="country">Country</label> |
|||
<select class="form-control s_website_form_input" id="country" |
|||
name="country"> |
|||
<t t-foreach="request.env['res.country'].sudo().search([])" |
|||
t-as="countries" t-key="countries.id"> |
|||
<option t-att-value="countries.id"> |
|||
<t t-esc="countries.name"/> |
|||
</option> |
|||
</t> |
|||
</select> |
|||
</div> |
|||
</xpath> |
|||
</template> |
|||
<template id="signup_form" inherit_id="auth_signup.signup"> |
|||
<xpath expr="//form[hasclass('oe_signup_form')]" position="attributes"> |
|||
<attribute name="enctype">multipart/form-data</attribute> |
|||
</xpath> |
|||
<xpath expr="//div[hasclass('oe_login_buttons')]" position="after"> |
|||
<!-- Added a button for extra information and hide information --> |
|||
<a name="toggle_active" string="Extra Information" class="btn btn-link btn-sm" id="info" type="button">Extra Information</a> |
|||
<a name="toggle_data" string="Hide Information" class="btn btn-link btn-sm" id="hide_info" type="button">Hide Information </a> |
|||
</xpath> |
|||
</template> |
|||
</odoo> |