diff --git a/geoip_website_redirect/README.rst b/geoip_website_redirect/README.rst new file mode 100755 index 000000000..26474725b --- /dev/null +++ b/geoip_website_redirect/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Website GeoIP Based Language and Currency +========================================= +This module allow to view the website content according to login user's country details + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V14) Mohammed Dilshad Tk, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +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 `__ + +Further information +=================== +External Package: countryinfo +HTML Description: ``__ diff --git a/geoip_website_redirect/__init__.py b/geoip_website_redirect/__init__.py new file mode 100755 index 000000000..a6c7f376f --- /dev/null +++ b/geoip_website_redirect/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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/geoip_website_redirect/__manifest__.py b/geoip_website_redirect/__manifest__.py new file mode 100755 index 000000000..690cfb826 --- /dev/null +++ b/geoip_website_redirect/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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': 'Website GeoIP Based Language and Currency', + 'version': '14.0.1.0.0', + 'category': 'eCommerce, Productivity', + 'summary': """Website GeoIP Based Language and Currency Application + for Odoo 14""", + 'description': """The module helps you to map currency and language + based on Customer's IP address""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://cybrosys.com', + 'depends': ['base', 'website_sale'], + 'data': [ + 'views/assets.xml', + 'views/login_template.xml' + ], + 'external_dependencies': { + 'python': ['countryinfo'], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False +} diff --git a/geoip_website_redirect/controllers/__init__.py b/geoip_website_redirect/controllers/__init__.py new file mode 100755 index 000000000..ef59ca7ea --- /dev/null +++ b/geoip_website_redirect/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 geoip_website_redirect diff --git a/geoip_website_redirect/controllers/geoip_website_redirect.py b/geoip_website_redirect/controllers/geoip_website_redirect.py new file mode 100755 index 000000000..4b79e9b01 --- /dev/null +++ b/geoip_website_redirect/controllers/geoip_website_redirect.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 requests +from countryinfo import CountryInfo +from odoo.addons.portal.controllers.web import Home +from odoo import http, _ +from odoo.exceptions import UserError +from odoo.http import request + + +class GeoIP(Home): + """ Controller for selecting login user's datas """ + + def get_location(self, ip_address): + """ Get location details of user using ip address""" + try: + response = requests.get( + f'http://ip-api.com/json/{ip_address}').json() + return {"country": response.get("country")} + except requests.exceptions.HTTPError as http_err: + raise UserError('HTTP error occurred: 'f'{http_err}') + # Handle HTTP errors (e.g., 404, 500) + except requests.exceptions.RequestException as req_err: + raise UserError('Request error occurred: 'f'{req_err}') + # Handle other request-related errors (e.g., timeout, + # connection error) + except Exception as e: + raise UserError('An unexpected error occurred: 'f'{e}') + + @http.route() + def web_login(self, redirect=None, **kw): + """ On login access customer country information """ + result = super(GeoIP, self).web_login(redirect=redirect, **kw) + request.env.user.write({'ip_address': kw.get('user_ip')}) + datas = self.get_location(kw.get('user_ip')) + if datas: + country = CountryInfo(datas['country']) + lang = country.languages() + language = request.env['res.lang'].sudo().search([ + ('iso_code', '=', lang[0]), ('active', 'in', [True, False])]) + if language: + language.active = True + request.env['website'].sudo().browse(request.website.id + ).language_ids = [ + (4, language.id)] + url = f'/{language.url_code}' + return request.redirect(url) + return result diff --git a/geoip_website_redirect/doc/RELEASE_NOTES.md b/geoip_website_redirect/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..958bf102e --- /dev/null +++ b/geoip_website_redirect/doc/RELEASE_NOTES.md @@ -0,0 +1,8 @@ +## Module + +#### 20.11.2023 +#### Version 14.0.1.0.0 +#### ADD + +- Initial commit for Website GeoIP Based Language and Currency + diff --git a/geoip_website_redirect/models/__init__.py b/geoip_website_redirect/models/__init__.py new file mode 100755 index 000000000..b6ac961d8 --- /dev/null +++ b/geoip_website_redirect/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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_users +from . import website diff --git a/geoip_website_redirect/models/res_users.py b/geoip_website_redirect/models/res_users.py new file mode 100755 index 000000000..39d1f266e --- /dev/null +++ b/geoip_website_redirect/models/res_users.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 ResUsers(models.Model): + """Class for adding ip address field in res users """ + _inherit = "res.users" + + ip_address = fields.Char(string="IP Address", help="IP address of the user") diff --git a/geoip_website_redirect/models/website.py b/geoip_website_redirect/models/website.py new file mode 100755 index 000000000..2258d2c84 --- /dev/null +++ b/geoip_website_redirect/models/website.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 requests +from countryinfo import CountryInfo +from odoo import models + + +class Website(models.Model): + """ Class for selecting shop's public pricelist """ + _inherit = 'website' + + def get_user_location(self): + """ Get location details of user """ + response = requests.get( + f'http://ip-api.com/json/{self.env.user.ip_address}').json() + return {"country": response.get("country")} + + def get_current_pricelist(self): + """ Get current price list if it is public pricelist then + change its currency into customers currency """ + res = super().get_current_pricelist() + default = self.env['product.pricelist'].search([ + '&', ('selectable', '=', True), + '&', ('country_group_ids', '=', False), + '|', ('company_id', '=', False), + ('company_id', '=', self.env.company.id)], limit=1) + if res in default: + datas = self.get_user_location() + if datas: + country = CountryInfo(datas['country']) + currency = country.currencies() + currency_dict = self.env['res.currency'].sudo().search([ + ('name', '=', currency[0]), + ('active', 'in', [True, False])]) + if currency_dict: + currency_dict.active = True + res.currency_id = currency_dict + return res diff --git a/geoip_website_redirect/static/description/assets/icons/check.png b/geoip_website_redirect/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/check.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/chevron.png b/geoip_website_redirect/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/chevron.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/cogs.png b/geoip_website_redirect/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/cogs.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/consultation.png b/geoip_website_redirect/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/consultation.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/ecom-black.png b/geoip_website_redirect/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/ecom-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/education-black.png b/geoip_website_redirect/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/education-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/hotel-black.png b/geoip_website_redirect/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/hotel-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/license.png b/geoip_website_redirect/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/license.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/lifebuoy.png b/geoip_website_redirect/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/lifebuoy.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/logo.png b/geoip_website_redirect/static/description/assets/icons/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/logo.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/manufacturing-black.png b/geoip_website_redirect/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/manufacturing-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/pos-black.png b/geoip_website_redirect/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/pos-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/puzzle.png b/geoip_website_redirect/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/puzzle.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/restaurant-black.png b/geoip_website_redirect/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/restaurant-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/service-black.png b/geoip_website_redirect/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/service-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/trading-black.png b/geoip_website_redirect/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/trading-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/training.png b/geoip_website_redirect/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/training.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/update.png b/geoip_website_redirect/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/update.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/user.png b/geoip_website_redirect/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/user.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/wrench.png b/geoip_website_redirect/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/wrench.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/categories.png b/geoip_website_redirect/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/categories.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/check-box.png b/geoip_website_redirect/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/check-box.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/compass.png b/geoip_website_redirect/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/compass.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/corporate.png b/geoip_website_redirect/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/corporate.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/customer-support.png b/geoip_website_redirect/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/customer-support.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/cybrosys-logo.png b/geoip_website_redirect/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/cybrosys-logo.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/features.png b/geoip_website_redirect/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/features.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/logo.png b/geoip_website_redirect/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/logo.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/pictures.png b/geoip_website_redirect/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/pictures.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/pie-chart.png b/geoip_website_redirect/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/pie-chart.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/right-arrow.png b/geoip_website_redirect/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/right-arrow.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/star.png b/geoip_website_redirect/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/star.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/support.png b/geoip_website_redirect/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/support.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/whatsapp.png b/geoip_website_redirect/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/whatsapp.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/cybrosys_support_client.png b/geoip_website_redirect/static/description/assets/modules/cybrosys_support_client.png new file mode 100755 index 000000000..e6f4f6d66 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/cybrosys_support_client.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/dynamic_accounts_report.png b/geoip_website_redirect/static/description/assets/modules/dynamic_accounts_report.png new file mode 100755 index 000000000..f55c47e0f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/dynamic_accounts_report.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/export_image.png b/geoip_website_redirect/static/description/assets/modules/export_image.png new file mode 100755 index 000000000..4e4ea0e51 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/export_image.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/magic_note.png b/geoip_website_redirect/static/description/assets/modules/magic_note.png new file mode 100755 index 000000000..9599391fa Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/magic_note.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/pdf_report_with_sign.png b/geoip_website_redirect/static/description/assets/modules/pdf_report_with_sign.png new file mode 100755 index 000000000..de0c2ef12 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/pdf_report_with_sign.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/project_dashboard_odoo.png b/geoip_website_redirect/static/description/assets/modules/project_dashboard_odoo.png new file mode 100755 index 000000000..e29d7e316 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/project_dashboard_odoo.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/2.png b/geoip_website_redirect/static/description/assets/screenshots/2.png new file mode 100755 index 000000000..3f9aa41ca Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/2.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/3.png b/geoip_website_redirect/static/description/assets/screenshots/3.png new file mode 100755 index 000000000..64fe6886f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/3.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/4.png b/geoip_website_redirect/static/description/assets/screenshots/4.png new file mode 100755 index 000000000..22e1f0bf1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/4.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/hero.gif b/geoip_website_redirect/static/description/assets/screenshots/hero.gif new file mode 100755 index 000000000..10de96737 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/hero.gif differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/img_1.png b/geoip_website_redirect/static/description/assets/screenshots/img_1.png new file mode 100755 index 000000000..3c99ce69d Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/img_1.png differ diff --git a/geoip_website_redirect/static/description/banner.png b/geoip_website_redirect/static/description/banner.png new file mode 100755 index 000000000..becdddf71 Binary files /dev/null and b/geoip_website_redirect/static/description/banner.png differ diff --git a/geoip_website_redirect/static/description/icon.png b/geoip_website_redirect/static/description/icon.png new file mode 100755 index 000000000..a5f84d678 Binary files /dev/null and b/geoip_website_redirect/static/description/icon.png differ diff --git a/geoip_website_redirect/static/description/index.html b/geoip_website_redirect/static/description/index.html new file mode 100755 index 000000000..c80746c43 --- /dev/null +++ b/geoip_website_redirect/static/description/index.html @@ -0,0 +1,658 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +
+
+
+

+ Website GeoIP Based
Language And Currency

+

+ Change Language And Currency Based On Country Of User In Odoo 14

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ Website GeoIP Based Language and Currency is an application which is + fetch the IP address + of customer's device and allow them to see website in their native + language and + see the currency as per the geolocation.This module uses the free IP API, + which allows 45 requests per minute, while the paid version offers unlimited requests. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Auto-Detect Customer's IP Address +
+
+ + Switch Website's Content in Customer's Native Language +
+
+ + Customer can Change Store Manually +
+
+ + Automatically activate the currency of native country +
+
+
+
+ + Product Price in Customer's Local Currency +
+
+ + Customer can also Change Language Manually +
+
+ + Select Customers Currency and Language on Login +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Customer Login

+

+ Before login website will be shown in default language

+ +
+
+

+ After Login

+

After, login it fetches + customers IP address and identify customer's + geolocation and select the language, change portal view based on + that language +

+ +
+
+

+ Change Website Default Language to Customer's Language

+
+
+
+

+ Change Currency

+

+ It, also change the product price into customer's local + currency.

+ +
+
+
+ + + +
+
+

Suggested 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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/geoip_website_redirect/static/src/js/action.js b/geoip_website_redirect/static/src/js/action.js new file mode 100755 index 000000000..a3db8e14d --- /dev/null +++ b/geoip_website_redirect/static/src/js/action.js @@ -0,0 +1,23 @@ +odoo.define('Geoip_website_redirect.get_ip', function (require) { + "use strict"; + var publicWidget = require('web.public.widget'); + // Public widget for getting the IP address of the user + publicWidget.registry.userIpAddress = publicWidget.Widget.extend({ + selector: '.oe_website_login_container', + events: { + 'click .oe_login_buttons': '_getIpAddress', + }, + setup(){ + super.setup(); + this._getIpAddress() + }, + // Function which give ip address of user + _getIpAddress: async function(events){ + var self = this; + await $.getJSON("https://api.ipify.org?format=json", function(data) { + self.el.querySelector('#user_ip').value = data.ip; + }); + }, + }); + return publicWidget.registry.userIpAddress; + }); diff --git a/geoip_website_redirect/views/assets.xml b/geoip_website_redirect/views/assets.xml new file mode 100755 index 000000000..6a5b88ddf --- /dev/null +++ b/geoip_website_redirect/views/assets.xml @@ -0,0 +1,11 @@ + + + +