From bef4ece2a69bc8c01c59e113bc45320b372486d1 Mon Sep 17 00:00:00 2001 From: Jan Brodersen <4rmitxes@gmail.com> Date: Thu, 14 Dec 2017 17:22:10 +0100 Subject: [PATCH 1/3] [FIX] website_coupon: Model access Include the "ir.model.access.csv" into the manifest file. Required since otherwise users (other than the admin) won't be able to access all the models / menuitems. --- website_coupon/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/website_coupon/__manifest__.py b/website_coupon/__manifest__.py index d774347e9..dca9ea800 100644 --- a/website_coupon/__manifest__.py +++ b/website_coupon/__manifest__.py @@ -32,6 +32,7 @@ 'depends': ['sale', 'website_sale'], 'website': 'http://www.cybrosys.com', 'data': [ + 'security/ir.model.access.csv', 'data/product_data.xml', 'views/gift_voucher.xml', 'views/applied_coupons.xml', From e2c32e54df104ff47cb8205d0d95e3b4a3b55ec7 Mon Sep 17 00:00:00 2001 From: Jan Brodersen <4rmitxes@gmail.com> Date: Thu, 14 Dec 2017 17:26:32 +0100 Subject: [PATCH 2/3] [REM] website_coupon: Remove duplicate manifest --- website_coupon/__manifest__.py~ | 42 --------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 website_coupon/__manifest__.py~ diff --git a/website_coupon/__manifest__.py~ b/website_coupon/__manifest__.py~ deleted file mode 100644 index 0654e27a5..000000000 --- a/website_coupon/__manifest__.py~ +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- - -############################################################################## -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: LINTO C T() -# 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': 'Website Coupon Code', - 'version': '10.0.2.0', - 'category': 'Website', - 'sequence': 56, - 'summary': 'Manage Website Coupon Codes for Products/Categories/All Products & Its Redeem Operations', - 'author': 'Cybrosys Techno Solutions', - 'company': 'Cybrosys Techno Solutions', - 'depends': ['sale', 'website_sale'], - 'website': 'http://www.cybrosys.com', - 'data': [ - 'data/product_data.xml', - 'views/gift_voucher.xml', - 'views/applied_coupons.xml', - 'views/templates.xml', - ], - 'installable': True, - 'auto_install': False, -} From 740eab9a4e6a0e9b37d7a2bcb9c71e4d886f58a5 Mon Sep 17 00:00:00 2001 From: Jan Brodersen <4rmitxes@gmail.com> Date: Thu, 14 Dec 2017 17:28:41 +0100 Subject: [PATCH 3/3] [FIX] website_coupon: Wrong indent Fixed indent. Otherwise "amount_final" have a high risk of not being set which causes an Internal Server Error. --- website_coupon/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website_coupon/controllers/main.py b/website_coupon/controllers/main.py index f01032689..506442dbd 100644 --- a/website_coupon/controllers/main.py +++ b/website_coupon/controllers/main.py @@ -125,7 +125,7 @@ class WebsiteCoupon(http.Controller): amount_final += (voucher_val / 100) * line.price_total elif voucher_type == 'all': amount_final = (voucher_val/100) * order.amount_total - res = coupon_product.product_tmpl_id.write({'list_price': -amount_final}) + res = coupon_product.product_tmpl_id.write({'list_price': -amount_final}) value = order._cart_update(product_id=coupon_product.id, set_qty=1, add_qty=1) # updating coupon balance--------------