diff --git a/website_restrict_country/README.rst b/website_restrict_country/README.rst new file mode 100644 index 000000000..8c1091a30 --- /dev/null +++ b/website_restrict_country/README.rst @@ -0,0 +1,46 @@ +.. 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: (V17) Ammu Raj, 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..16d6e4700 --- /dev/null +++ b/website_restrict_country/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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..7f4975eab --- /dev/null +++ b/website_restrict_country/__manifest__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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': '17.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..35cb42eac --- /dev/null +++ b/website_restrict_country/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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..91ca6e133 --- /dev/null +++ b/website_restrict_country/controllers/website_restrict_country.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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_countries(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 = http.Response( + template='website_restrict_country.country_selection', + qcontext={'country': country_id, + 'countries': website_id.country_ids}) + return response.render() diff --git a/website_restrict_country/doc/RELEASE_NOTES.md b/website_restrict_country/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..b2e176c97 --- /dev/null +++ b/website_restrict_country/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 05.06.2024 +#### Version 17.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..52d93adf8 --- /dev/null +++ b/website_restrict_country/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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..965c325d0 --- /dev/null +++ b/website_restrict_country/models/country_details.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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..4763653d3 --- /dev/null +++ b/website_restrict_country/models/product_template.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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..6bb8109d6 --- /dev/null +++ b/website_restrict_country/models/sale_order.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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..6783491e6 --- /dev/null +++ b/website_restrict_country/models/website.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj (odoo@cybrosys.com) +# +# 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/capture (1).png b/website_restrict_country/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/capture (1).png differ 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/img.png b/website_restrict_country/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/img.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/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/photo-capture.png b/website_restrict_country/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/website_restrict_country/static/description/assets/icons/photo-capture.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/misc/Cybrosys R.png b/website_restrict_country/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/website_restrict_country/static/description/assets/misc/Cybrosys R.png differ diff --git a/website_restrict_country/static/description/assets/misc/email.svg b/website_restrict_country/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_restrict_country/static/description/assets/misc/phone.svg b/website_restrict_country/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_restrict_country/static/description/assets/misc/star (1) 2.svg b/website_restrict_country/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_restrict_country/static/description/assets/misc/support (1) 1.svg b/website_restrict_country/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_restrict_country/static/description/assets/misc/support-email.svg b/website_restrict_country/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/website_restrict_country/static/description/assets/misc/tick-mark.svg b/website_restrict_country/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/website_restrict_country/static/description/assets/misc/whatsapp 1.svg b/website_restrict_country/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_restrict_country/static/description/assets/misc/whatsapp.svg b/website_restrict_country/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/website_restrict_country/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..0e311ca87 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..a0ac2d840 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..cb17cf612 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.jpg b/website_restrict_country/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/4.jpg 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..8513873ea 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.jpg b/website_restrict_country/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..73781cf50 Binary files /dev/null and b/website_restrict_country/static/description/assets/modules/6.jpg 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..4ad90ce0a 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..1de69959e 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..df09ef30f 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..e59f49584 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..479946deb 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..4f70c3d92 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/7.png b/website_restrict_country/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..87293952a Binary files /dev/null and b/website_restrict_country/static/description/assets/screenshots/7.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..6e16d9cba 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..259cc67b7 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..1818bb9ac Binary files /dev/null and b/website_restrict_country/static/description/icon.png 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..48bdf25fb --- /dev/null +++ b/website_restrict_country/static/description/index.html @@ -0,0 +1,678 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Website Restrict Country

+

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

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Countries can be added in the website.

+
+
+
+
+
+
+ +
+
+

Restrict ordering unavailable products of the Country.

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

Top Navigation bar with country list.

+
+
+
+
+
+
+ +
+
+

Direct BUY NOW is restricted for unavailable Products.

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

custom messages for products they are unavailable.

+
+
+
+
+
+
+ +
+
+

Restricts the checkout process.

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

+ Set Countries in the backend.

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+ +
+
+

+ Top Navigation bar will display selected country list.

+
+
+
+
+
+
+ +
+
+

+ If the product is not available, users are restricted from using the direct "Buy Now" option.

+
+
+
+
+
+
+ +
+
+

+ On the cart page, created a custom message for the unavailable product in a country.

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+
    +
  • + Customer can attach files in the "my account" screen and "payment" screen. +
  • +
  • + Customer can upload both image and pdf files. +
  • +
  • + Customer can upload multiple files. +
  • +
  • + It is available for all manual transactions. +
  • +
  • + Admin can see the uploaded file in the sale order section. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:20th January 2024 +
+

+ + Initial Commit for Payment Proof Attachment.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

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

Odoo Customization

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

Odoo Implementation

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

Odoo Support

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

Hire Odoo Developer

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

Odoo Integration

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

Odoo Migration

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

Odoo Consultancy

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

Odoo Implementation

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

Odoo Licensing Consultancy

+
+
+
+
+
+
+

Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

Education

+

A platform for educational management

+
+
+
+
+ +

Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service Management

+

Keep track of services and invoice

+
+
+
+
+ +

Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

Support

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

Got questions or need help? Get in touch.

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

Say hi to us on WhatsApp!

+
+91 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/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..e1292d001 --- /dev/null +++ b/website_restrict_country/static/src/js/country_selection.js @@ -0,0 +1,21 @@ +/** @odoo-module **/ +import { jsonrpc } from "@web/core/network/rpc_service"; +import publicWidget from "@web/legacy/js/public/public_widget"; + + publicWidget.registry.Country_detail = publicWidget.Widget.extend({ + selector: ".js_countrymenu", + events: { + 'click .js_countries': 'OnClickChangeCountry', + }, + // Added a Click function to select the country + OnClickChangeCountry: function(e) { + event.preventDefault(e); + var country_id = e.currentTarget.dataset['country_id'] + var self = this; + jsonrpc('/website/countries', { 'country_id': country_id}) + .then(result => { + $(e.currentTarget).parent().parent().html(result) + 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..2c81026a6 --- /dev/null +++ b/website_restrict_country/views/product_template_views.xml @@ -0,0 +1,32 @@ + + + + + + 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..67006aa8e --- /dev/null +++ b/website_restrict_country/views/website_templates.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + diff --git a/website_restrict_country/views/website_views.xml b/website_restrict_country/views/website_views.xml new file mode 100644 index 000000000..7f79205a9 --- /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 +
+
+ + + +
+
+
+
+