diff --git a/website_restrict_country/README.rst b/website_restrict_country/README.rst new file mode 100644 index 000000000..2d919412e --- /dev/null +++ b/website_restrict_country/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Website Restrict Country +======================== +* The Website Restrict Country module allows you to set restrictions for +products that are unavailable in certain countries + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: + (V15) Jumana Haseen, + (v16) Saleekha Musthari, +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 `__ + +Further information +=================== +HTML Description: ``__ diff --git a/website_restrict_country/__init__.py b/website_restrict_country/__init__.py new file mode 100644 index 000000000..c3a72fd6d --- /dev/null +++ b/website_restrict_country/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen() +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/website_restrict_country/__manifest__.py b/website_restrict_country/__manifest__.py new file mode 100644 index 000000000..043f02878 --- /dev/null +++ b/website_restrict_country/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Website Restrict Country', + 'version': '15.0.1.0.0', + 'category': 'Website', + 'summary': """ The Website Restrict Country module allows you to set + restrictions for products that are unavailable in certain countries. + """, + 'description': """ The Website Restrict Country module allows you to set + restrictions for products that are unavailable in certain countries.And You + can customise the cart and checkout message that is displayed. Customers + can select from the countries you specify in the Odoo backend.""", + 'author': ' Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['stock', 'website_sale', 'sale_stock', + 'sale_management'], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_template_views.xml', + 'views/website_templates.xml', + 'views/website_views.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'website_restrict_country/static/src/js/country_selection.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_restrict_country/controllers/__init__.py b/website_restrict_country/controllers/__init__.py new file mode 100644 index 000000000..ada29a07e --- /dev/null +++ b/website_restrict_country/controllers/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import website_restrict_country diff --git a/website_restrict_country/controllers/website_restrict_country.py b/website_restrict_country/controllers/website_restrict_country.py new file mode 100644 index 000000000..a2259bc3d --- /dev/null +++ b/website_restrict_country/controllers/website_restrict_country.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Juman Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import http +from odoo.http import request + + +class WebsiteCountry(http.Controller): + """ + This controller used to pass the selected country to the corresponding + template + """ + @http.route('/website/countries', type='json', auth="user", website=True) + def website_languages(self, country_id): + """ + This function used to search the country id, and it renders the + details of the selected country in to the template. + """ + country_id = request.env['res.country'].browse(int(country_id)) + website_id = request.env['website'].browse(request.website.id) + website_id.default_country_id = country_id.id + + response = { + 'country_name': country_id.name, + 'country_image_url': country_id.image_url, + 'country_code': country_id.code + } + return response diff --git a/website_restrict_country/doc/RELEASE_NOTES.md b/website_restrict_country/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..e3784d2c0 --- /dev/null +++ b/website_restrict_country/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 05.09.2024 +#### Version 15.0.1.0.0 +##### ADD +- Initial Commit for Website Restrict Country diff --git a/website_restrict_country/models/__init__.py b/website_restrict_country/models/__init__.py new file mode 100644 index 000000000..80f944d67 --- /dev/null +++ b/website_restrict_country/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import country_details +from . import product_template +from . import sale_order +from . import website diff --git a/website_restrict_country/models/country_details.py b/website_restrict_country/models/country_details.py new file mode 100644 index 000000000..d1968dcc4 --- /dev/null +++ b/website_restrict_country/models/country_details.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class CountryDetails(models.Model): + """ + Added a new model and added some fields with the details of the + countries + """ + _name = "country.details" + _description = 'Country Details' + + country_id = fields.Many2one(string="Country", comodel_name='res.country', + help='User can select the country', + required=True) + country_code = fields.Char(related='country_id.code', string="Country Code", + help='The code of the corresponding country') + select_country_id = fields.Many2one(string='Select Country Id', + comodel_name='product.template', + help='User can select the country id') diff --git a/website_restrict_country/models/product_template.py b/website_restrict_country/models/product_template.py new file mode 100644 index 000000000..6c6a614ac --- /dev/null +++ b/website_restrict_country/models/product_template.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ProductTemplate(models.Model): + """ + This class inherited to add some extra fields in the + product contains the details of countries + """ + _inherit = "product.template" + + country_availability = fields.Selection([ + ('all', 'All'), + ('selected', 'Selected')], string="Available in countries", + default='all', help='Can select the type all or selected') + country_selection_ids = fields.One2many('country.details', + 'select_country_id', + string='Selected Country', + help='List of countries contains ' + 'corresponding products') diff --git a/website_restrict_country/models/sale_order.py b/website_restrict_country/models/sale_order.py new file mode 100644 index 000000000..f32f98fb0 --- /dev/null +++ b/website_restrict_country/models/sale_order.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +import logging +from functools import reduce +from odoo import models + +_logger = logging.getLogger(__name__) + + +class SaleOrder(models.Model): + """ + This class inherits to add a function to the sale.order + for fetching the common country list. + """ + _inherit = 'sale.order' + + @property + def get_common_country_list(self): + """ + This function is added for fetching the common country list. + """ + lst = [] + for line in self.order_line: + if line.product_id.product_tmpl_id.country_availability != 'all': + lst.append( + line.product_id.product_tmpl_id.country_selection_ids.mapped( + 'country_id.id')) + try: + country_list = list( + reduce(lambda i, j: i & j, (set(x) for x in lst))) + except Exception as error: + _logger.info(f'Country list has been made empty list due to {error}') + country_list = [] + return country_list diff --git a/website_restrict_country/models/website.py b/website_restrict_country/models/website.py new file mode 100644 index 000000000..ee2807de0 --- /dev/null +++ b/website_restrict_country/models/website.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Jumana Haseen () +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class Website(models.Model): + """ + This class inherited to add some extra fields in the + website backend + """ + _inherit = 'website' + + country_ids = fields.Many2many(string="Countries", + comodel_name='res.country', required=True, + help='Select a list of countries') + default_country_id = fields.Many2one(string="Default", required=True, + comodel_name='res.country', + help='Set a default country') + cart_message = fields.Char(string="Cart Message", + help='Custom message display if the product ' + 'is not available') diff --git a/website_restrict_country/security/ir.model.access.csv b/website_restrict_country/security/ir.model.access.csv new file mode 100644 index 000000000..c7de6456d --- /dev/null +++ b/website_restrict_country/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_country_details_user,access.country.details.user,model_country_details,base.group_user,1,1,1,1 diff --git a/website_restrict_country/static/description/assets/icons/check.png b/website_restrict_country/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/check.png differ diff --git a/website_restrict_country/static/description/assets/icons/chevron.png b/website_restrict_country/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/chevron.png differ diff --git a/website_restrict_country/static/description/assets/icons/cogs.png b/website_restrict_country/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/cogs.png differ diff --git a/website_restrict_country/static/description/assets/icons/consultation.png b/website_restrict_country/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/consultation.png differ diff --git a/website_restrict_country/static/description/assets/icons/ecom-black.png b/website_restrict_country/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/ecom-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/education-black.png b/website_restrict_country/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/education-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/hotel-black.png b/website_restrict_country/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/hotel-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/license.png b/website_restrict_country/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/license.png differ diff --git a/website_restrict_country/static/description/assets/icons/lifebuoy.png b/website_restrict_country/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/lifebuoy.png differ diff --git a/website_restrict_country/static/description/assets/icons/logo.png b/website_restrict_country/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/logo.png differ diff --git a/website_restrict_country/static/description/assets/icons/manufacturing-black.png b/website_restrict_country/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/pos-black.png b/website_restrict_country/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/pos-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/puzzle.png b/website_restrict_country/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/puzzle.png differ diff --git a/website_restrict_country/static/description/assets/icons/restaurant-black.png b/website_restrict_country/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/restaurant-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/service-black.png b/website_restrict_country/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/service-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/trading-black.png b/website_restrict_country/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/trading-black.png differ diff --git a/website_restrict_country/static/description/assets/icons/training.png b/website_restrict_country/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/training.png differ diff --git a/website_restrict_country/static/description/assets/icons/update.png b/website_restrict_country/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/update.png differ diff --git a/website_restrict_country/static/description/assets/icons/user.png b/website_restrict_country/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/user.png differ diff --git a/website_restrict_country/static/description/assets/icons/wrench.png b/website_restrict_country/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/wrench.png differ diff --git a/website_restrict_country/static/description/assets/modules/1.png b/website_restrict_country/static/description/assets/modules/1.png new file mode 100644 index 000000000..50dff361b Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/1.png differ diff --git a/website_restrict_country/static/description/assets/modules/2.png b/website_restrict_country/static/description/assets/modules/2.png new file mode 100644 index 000000000..5cfca7c3d Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/2.png differ diff --git a/website_restrict_country/static/description/assets/modules/3.png b/website_restrict_country/static/description/assets/modules/3.png new file mode 100644 index 000000000..a5c11cc1e Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/3.png differ diff --git a/website_restrict_country/static/description/assets/modules/4.png b/website_restrict_country/static/description/assets/modules/4.png new file mode 100644 index 000000000..dd50afa73 Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/4.png differ diff --git a/website_restrict_country/static/description/assets/modules/5.png b/website_restrict_country/static/description/assets/modules/5.png new file mode 100644 index 000000000..d3a51b0a6 Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/5.png differ diff --git a/website_restrict_country/static/description/assets/modules/6.png b/website_restrict_country/static/description/assets/modules/6.png new file mode 100644 index 000000000..634431724 Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/6.png differ diff --git a/website_restrict_country/static/description/assets/screenshots/1.png b/website_restrict_country/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..a1ae2d849 Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/1.png differ diff --git a/website_restrict_country/static/description/assets/screenshots/2.png b/website_restrict_country/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..746353e8e Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/2.png differ diff --git a/website_restrict_country/static/description/assets/screenshots/3.png b/website_restrict_country/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..3f0dd2d3a Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/3.png differ diff --git a/website_restrict_country/static/description/assets/screenshots/4.png b/website_restrict_country/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..8ed49b989 Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/4.png differ diff --git a/website_restrict_country/static/description/assets/screenshots/5.png b/website_restrict_country/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..d76f85edf Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/5.png differ diff --git a/website_restrict_country/static/description/assets/screenshots/6.png b/website_restrict_country/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..31851e72e Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/6.png differ diff --git a/website_restrict_country/static/description/assets/screenshots/hero.gif b/website_restrict_country/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..9b25ee328 Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/hero.gif differ diff --git a/website_restrict_country/static/description/banner.png b/website_restrict_country/static/description/banner.png new file mode 100644 index 000000000..a37d665af Binary files /dev/null and b/website_restrict_country/static/description/banner.png differ diff --git a/website_restrict_country/static/description/icon.png b/website_restrict_country/static/description/icon.png new file mode 100644 index 000000000..fd1d9d6aa Binary files /dev/null and b/website_restrict_country/static/description/icon.png differ diff --git a/website_restrict_country/static/description/images/checked.png b/website_restrict_country/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/website_restrict_country/static/description/images/checked.png differ diff --git a/website_restrict_country/static/description/images/cybrosys.png b/website_restrict_country/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/website_restrict_country/static/description/images/cybrosys.png differ diff --git a/website_restrict_country/static/description/images/hero.gif b/website_restrict_country/static/description/images/hero.gif new file mode 100644 index 000000000..9dd538182 Binary files /dev/null and b/website_restrict_country/static/description/images/hero.gif differ diff --git a/website_restrict_country/static/description/images/odoo-powr-countdown-timer-12.0.1.0.zip b/website_restrict_country/static/description/images/odoo-powr-countdown-timer-12.0.1.0.zip new file mode 100644 index 000000000..54b4beb1f Binary files /dev/null and b/website_restrict_country/static/description/images/odoo-powr-countdown-timer-12.0.1.0.zip differ diff --git a/website_restrict_country/static/description/images/product_brand_ecommerce.png b/website_restrict_country/static/description/images/product_brand_ecommerce.png new file mode 100644 index 000000000..2ac89b363 Binary files /dev/null and b/website_restrict_country/static/description/images/product_brand_ecommerce.png differ diff --git a/website_restrict_country/static/description/images/scrn1.png b/website_restrict_country/static/description/images/scrn1.png new file mode 100644 index 000000000..6d43d09de Binary files /dev/null and b/website_restrict_country/static/description/images/scrn1.png differ diff --git a/website_restrict_country/static/description/images/scrn2.png b/website_restrict_country/static/description/images/scrn2.png new file mode 100644 index 000000000..f471017d0 Binary files /dev/null and b/website_restrict_country/static/description/images/scrn2.png differ diff --git a/website_restrict_country/static/description/images/scrn3.png b/website_restrict_country/static/description/images/scrn3.png new file mode 100644 index 000000000..22efb712d Binary files /dev/null and b/website_restrict_country/static/description/images/scrn3.png differ diff --git a/website_restrict_country/static/description/images/scrn4.png b/website_restrict_country/static/description/images/scrn4.png new file mode 100644 index 000000000..03dc58ee9 Binary files /dev/null and b/website_restrict_country/static/description/images/scrn4.png differ diff --git a/website_restrict_country/static/description/images/scrn5.png b/website_restrict_country/static/description/images/scrn5.png new file mode 100644 index 000000000..307237daf Binary files /dev/null and b/website_restrict_country/static/description/images/scrn5.png differ diff --git a/website_restrict_country/static/description/images/scrn6.png b/website_restrict_country/static/description/images/scrn6.png new file mode 100644 index 000000000..78c08cf99 Binary files /dev/null and b/website_restrict_country/static/description/images/scrn6.png differ diff --git a/website_restrict_country/static/description/images/scrn7.png b/website_restrict_country/static/description/images/scrn7.png new file mode 100644 index 000000000..37022a686 Binary files /dev/null and b/website_restrict_country/static/description/images/scrn7.png differ diff --git a/website_restrict_country/static/description/images/website_featured_products.jpeg b/website_restrict_country/static/description/images/website_featured_products.jpeg new file mode 100644 index 000000000..9542b3f7a Binary files /dev/null and b/website_restrict_country/static/description/images/website_featured_products.jpeg differ diff --git a/website_restrict_country/static/description/images/website_repeat_sale.jpeg b/website_restrict_country/static/description/images/website_repeat_sale.jpeg new file mode 100644 index 000000000..a749a22d9 Binary files /dev/null and b/website_restrict_country/static/description/images/website_repeat_sale.jpeg differ diff --git a/website_restrict_country/static/description/images/website_sale_product_quick_view.jpeg b/website_restrict_country/static/description/images/website_sale_product_quick_view.jpeg new file mode 100644 index 000000000..6fa520659 Binary files /dev/null and b/website_restrict_country/static/description/images/website_sale_product_quick_view.jpeg differ diff --git a/website_restrict_country/static/description/index.html b/website_restrict_country/static/description/index.html new file mode 100644 index 000000000..b479b0018 --- /dev/null +++ b/website_restrict_country/static/description/index.html @@ -0,0 +1,684 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+ +
+
+
+

+ Website Restrict Country

+

+ Website Restrict Country for Products that are Unavailable in + Certain Countries. +

+ +
+
+ + +
+
+

+ Overview +

+
+ +
+

+ This module allows you to set + restrictions for products that are unavailable in + certain countries.And You can customise the cart and + checkout message that is displayed. Customers can select + from the countries you specify in the Odoo backend +

+
+

+
+
+
+

+ Features +

+
+
+
+ +
+
+

+ Countries can be added in the website

+
+
+
+
+ +
+
+

+ Restrict ordering unavailable products.

+
+
+
+
+ +
+
+

+ Top Navigation bar with country list.

+
+
+
+
+ +
+
+

+ Custom messages for products that are unavailable.

+
+
+
+
+ +
+
+

+ Restrict the checkout process.

+
+
+
+
+
+

+ Screenshots +

+
+
+

+ Set Countries in the backend

+

User can configure the countries in the website odoo + backend.

+ +
+ +
+

+ Custom messages for products that are unavailable

+

User can add custom messages for products that are + unavailable.

+ +
+
+

+ Product configuration for all or a specific country

+

Product configuration for all or a specific country in the + backend.

+ +
+
+

+ Top Navigation bar with country list

+

Top Navigation bar will displays selected country list.

+ +
+
+

+ Custom message for unavailable product in a country

+

On the cart page,create a custom for unavailable product in a country.

+ +
+
+

+ Restrict the checkout process

+

When the product is restricted in this country, the checkout process is restricted.

+ +
+
+ +
+
+

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

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/website_restrict_country/static/src/js/country_selection.js b/website_restrict_country/static/src/js/country_selection.js new file mode 100644 index 000000000..a51cec259 --- /dev/null +++ b/website_restrict_country/static/src/js/country_selection.js @@ -0,0 +1,41 @@ +odoo.define('website_restrict_company.countries', function(require) { + "use strict"; + var ajax = require('web.ajax'); + var publicWidget = require('web.public.widget'); + + // Extended PublicWidget + publicWidget.registry.Country_detail = publicWidget.Widget.extend({ + selector: ".js_countrymenu", + events: { + 'click .js_countries': 'OnClickChangeCountry', + 'click .dropdown-toggle': 'OnToggleDropdown' + }, + + // Toggle the dropdown visibility + OnToggleDropdown: function(e) { + e.preventDefault(); + $(e.currentTarget).next('.dropdown-menu').toggleClass('show'); + }, + + // Added a Click function to select the country + OnClickChangeCountry: function(e) { + e.preventDefault(); + var country_id = e.currentTarget.dataset['country_id']; + var self = this; + ajax.jsonRpc('/website/countries', 'call', { 'country_id': country_id }) + .then(function(result) { + if (result) { + // Update the dropdown button to show the selected country + var country_image_url = result.country_image_url; + var country_name = result.country_name; + var dropdownButton = $(e.currentTarget).closest('.js_countrymenu').find('.dropdown-toggle'); + dropdownButton.html(' ' + country_name); + + // Close the dropdown + $(e.currentTarget).closest('.dropdown-menu').removeClass('show'); + window.location.reload(); + } + }); + }, + }); +}); diff --git a/website_restrict_country/views/product_template_views.xml b/website_restrict_country/views/product_template_views.xml new file mode 100644 index 000000000..35b876352 --- /dev/null +++ b/website_restrict_country/views/product_template_views.xml @@ -0,0 +1,33 @@ + + + + + + product.template.view.form.inherit.website.restrict.country + + product.template + + + + + + + + + + + + + + + + + + + + + diff --git a/website_restrict_country/views/website_templates.xml b/website_restrict_country/views/website_templates.xml new file mode 100644 index 000000000..5e579c2eb --- /dev/null +++ b/website_restrict_country/views/website_templates.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + diff --git a/website_restrict_country/views/website_views.xml b/website_restrict_country/views/website_views.xml new file mode 100644 index 000000000..8187070c5 --- /dev/null +++ b/website_restrict_country/views/website_views.xml @@ -0,0 +1,38 @@ + + + + + website.view.form.inherit.website.restrict.country + + website + + + + +
SELECT COUNTRIES +
+
+ + + + + + + + +
+
WHEN A PRODUCT IS NOT AVAILABLE IN A + COUNTRY, MESSAGES ARE DISPLAYED +
+
+ + + +
+
+
+
+