From 341a721524377679ffffa0c9620ad46b70c9e9bc Mon Sep 17 00:00:00 2001 From: SHEREEF PT Date: Sat, 4 Nov 2017 12:37:32 +0530 Subject: [PATCH] [FIX] Args Value to Function --- .../__manifest__.py | 2 +- .../__manifest__.py~ | 48 +++++++++++++++++++ .../controllers/main.py | 2 +- .../controllers/main.py~ | 29 +++++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 website_sale_product_quick_view/__manifest__.py~ create mode 100644 website_sale_product_quick_view/controllers/main.py~ diff --git a/website_sale_product_quick_view/__manifest__.py b/website_sale_product_quick_view/__manifest__.py index de76e96a7..09ddb889c 100644 --- a/website_sale_product_quick_view/__manifest__.py +++ b/website_sale_product_quick_view/__manifest__.py @@ -23,7 +23,7 @@ { 'name': "E-commerce Product Quick View", - 'version': '10.0.1.0.0', + 'version': '10.0.2.0.0', 'summary': """E-commerce Product Quick View.""", 'description': """E-commerce Product Quick View.""", 'author': 'Cybrosys Techno Solutions', diff --git a/website_sale_product_quick_view/__manifest__.py~ b/website_sale_product_quick_view/__manifest__.py~ new file mode 100644 index 000000000..de76e96a7 --- /dev/null +++ b/website_sale_product_quick_view/__manifest__.py~ @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Hilar AK() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': "E-commerce Product Quick View", + 'version': '10.0.1.0.0', + 'summary': """E-commerce Product Quick View.""", + 'description': """E-commerce Product Quick View.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com", + 'category': 'eCommerce', + 'depends': ['base', + 'website_sale', + 'website_mail', + 'rating', + ], + 'data': [ + # 'security/ir.model.access.csv', + 'views/assets.xml', + 'views/template.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': True +} diff --git a/website_sale_product_quick_view/controllers/main.py b/website_sale_product_quick_view/controllers/main.py index c9b0123a4..89003f2e4 100644 --- a/website_sale_product_quick_view/controllers/main.py +++ b/website_sale_product_quick_view/controllers/main.py @@ -21,7 +21,7 @@ class WebsiteSaleExtend(main.WebsiteSale): :param post: :return: """ - response = super(WebsiteSaleExtend, self).shop(page=0, category=None, search='', ppg=False, **post) + response = super(WebsiteSaleExtend, self).shop(page=page, category=category, search=search, ppg=ppg, **post) response.qcontext.update({ 'get_attribute_value_ids': self.get_attribute_value_ids, 'rating_status': response.qcontext.get('rating_product'), diff --git a/website_sale_product_quick_view/controllers/main.py~ b/website_sale_product_quick_view/controllers/main.py~ new file mode 100644 index 000000000..c9b0123a4 --- /dev/null +++ b/website_sale_product_quick_view/controllers/main.py~ @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +from odoo import http +from odoo.addons.website_sale.controllers import main + + +class WebsiteSaleExtend(main.WebsiteSale): + @http.route([ + '/shop', + '/shop/page/', + '/shop/category/', + '/shop/category//page/' + ], type='http', auth="public", website=True) + def shop(self, page=0, category=None, search='', ppg=False, **post): + """ + Overrided function to update the response with products objects.Here we are updating qcontext. + :param page: + :param category: + :param search: + :param ppg: + :param post: + :return: + """ + response = super(WebsiteSaleExtend, self).shop(page=0, category=None, search='', ppg=False, **post) + response.qcontext.update({ + 'get_attribute_value_ids': self.get_attribute_value_ids, + 'rating_status': response.qcontext.get('rating_product'), + }) + return response