Browse Source

Sep 10: [FIX] Bug Fixed 'call_for_price_website'

pull/332/merge
Cybrosys Technologies 8 months ago
parent
commit
3a6fe32c28
  1. 4
      call_for_price_website/__manifest__.py
  2. 15
      call_for_price_website/models/product_product.py

4
call_for_price_website/__manifest__.py

@ -28,8 +28,8 @@
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',
'images': ['static/description/banner.png'], 'images': ['static/description/banner.png'],
'website': 'https://www.cybrosys.com', 'website': 'https://www.cybrosys.com',
'depends': ['base', 'website_sale', 'website_sale_wishlist', 'depends': ['website_sale', 'website_sale_wishlist',
'website_sale_comparison', 'stock'], 'website_sale_comparison', 'website_sale_stock'],
'summary': """Helps to hide price of specified product from shop""", 'summary': """Helps to hide price of specified product from shop""",
'description': "Hide price and add to cart item button of All page stores" 'description': "Hide price and add to cart item button of All page stores"
"and user must ask for a call for price", "and user must ask for a call for price",

15
call_for_price_website/models/product_product.py

@ -27,6 +27,14 @@ class ProductTemplate(models.Model):
the combination_info""" the combination_info"""
_inherit = 'product.template' _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, def _get_combination_info(self, combination=False, product_id=False,
add_qty=1, pricelist=False, add_qty=1, pricelist=False,
parent_combination=False, parent_combination=False,
@ -55,3 +63,10 @@ class ProductProduct(models.Model):
help="This will hide the price and cart button" help="This will hide the price and cart button"
"from shop and customer can request by " "from shop and customer can request by "
"calling for price") "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()
Loading…
Cancel
Save