From 3a6fe32c286565c4585219162b07e364b98c1bc6 Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Tue, 10 Sep 2024 11:17:46 +0530 Subject: [PATCH] Sep 10: [FIX] Bug Fixed 'call_for_price_website' --- call_for_price_website/__manifest__.py | 4 ++-- call_for_price_website/models/product_product.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/call_for_price_website/__manifest__.py b/call_for_price_website/__manifest__.py index 2be9d9a5c..eab4eec29 100644 --- a/call_for_price_website/__manifest__.py +++ b/call_for_price_website/__manifest__.py @@ -28,8 +28,8 @@ 'maintainer': 'Cybrosys Techno Solutions', 'images': ['static/description/banner.png'], 'website': 'https://www.cybrosys.com', - 'depends': ['base', 'website_sale', 'website_sale_wishlist', - 'website_sale_comparison', 'stock'], + 'depends': ['website_sale', 'website_sale_wishlist', + 'website_sale_comparison', 'website_sale_stock'], 'summary': """Helps to hide price of specified product from shop""", 'description': "Hide price and add to cart item button of All page stores" "and user must ask for a call for price", diff --git a/call_for_price_website/models/product_product.py b/call_for_price_website/models/product_product.py index e1119cfea..d78639840 100644 --- a/call_for_price_website/models/product_product.py +++ b/call_for_price_website/models/product_product.py @@ -27,6 +27,14 @@ class ProductTemplate(models.Model): the combination_info""" _inherit = 'product.template' + def _website_show_quick_add(self): + self.ensure_one() + product= self.env['product.product'].search([('product_tmpl_id', '=', self.id)],limit=1) + if product: + if product.price_call: + return False + return super()._website_show_quick_add() + def _get_combination_info(self, combination=False, product_id=False, add_qty=1, pricelist=False, parent_combination=False, @@ -55,3 +63,10 @@ class ProductProduct(models.Model): help="This will hide the price and cart button" "from shop and customer can request by " "calling for price") + + def _website_show_quick_add(self): + self.ensure_one() + if self.price_call: + return False + else: + return super()._website_show_quick_add() \ No newline at end of file