diff --git a/website_restrict_country/__manifest__.py b/website_restrict_country/__manifest__.py index 7f4975eab..417d4395e 100644 --- a/website_restrict_country/__manifest__.py +++ b/website_restrict_country/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################### { 'name': 'Website Restrict Country', - 'version': '17.0.1.0.0', + 'version': '17.0.1.0.1', 'category': 'Website', 'summary': "The Website Restrict Country module allows you to set" "restrictions for products that are unavailable in certain" diff --git a/website_restrict_country/controllers/website_restrict_country.py b/website_restrict_country/controllers/website_restrict_country.py index 91ca6e133..f47d44434 100644 --- a/website_restrict_country/controllers/website_restrict_country.py +++ b/website_restrict_country/controllers/website_restrict_country.py @@ -24,18 +24,14 @@ 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) + """ This controller used to pass the selected country to the corresponding + template. """ + @http.route('/website/countries', type='json', auth="public", 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) + """ 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'].sudo().browse(int(country_id)) + website_id = request.env['website'].sudo().browse(request.website.id) website_id.default_country_id = country_id.id response = http.Response( template='website_restrict_country.country_selection', diff --git a/website_restrict_country/doc/RELEASE_NOTES.md b/website_restrict_country/doc/RELEASE_NOTES.md index b2e176c97..c76ea1cb9 100644 --- a/website_restrict_country/doc/RELEASE_NOTES.md +++ b/website_restrict_country/doc/RELEASE_NOTES.md @@ -4,3 +4,8 @@ #### Version 17.0.1.0.0 ##### ADD - Initial Commit for Website Restrict Country + +#### 07.10.2024 +#### Version 17.0.1.0.1 +##### BUGFIX +- Fixed the errors in selecting the country for portal and public users. \ No newline at end of file diff --git a/website_restrict_country/security/ir.model.access.csv b/website_restrict_country/security/ir.model.access.csv index c7de6456d..ecae70ad1 100644 --- a/website_restrict_country/security/ir.model.access.csv +++ b/website_restrict_country/security/ir.model.access.csv @@ -1,2 +1,4 @@ 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 +access_res_country_user,access.res.country.user,base.model_res_country,base.group_portal,1,0,0,0 +access_res_country_public,access.res.country.public,base.model_res_country,base.group_public,1,0,0,0 diff --git a/website_restrict_country/views/website_templates.xml b/website_restrict_country/views/website_templates.xml index 67006aa8e..3fed6fc6e 100644 --- a/website_restrict_country/views/website_templates.xml +++ b/website_restrict_country/views/website_templates.xml @@ -130,11 +130,11 @@ - + t-att-href="step_specific_values.get('main_button_href', '#')"> + Checkout - + \ No newline at end of file