esale_menus_by_website and active menus

This commit is contained in:
Raimon Esteve 2022-04-29 14:24:04 +02:00
parent b6ae6974e9
commit 468050a6f0
1 changed files with 4 additions and 2 deletions

View File

@ -102,9 +102,11 @@ class Template(metaclass=PoolMeta):
Category = Pool().get('product.category')
if hasattr(Category, 'esale_active'):
return [cat for cat in self.categories if website in cat.websites]
return [cat for cat in self.categories
if website in cat.websites and cat.esale_active == True]
else:
return [menu for menu in self.esale_menus if website == menu.website]
return [menu for menu in self.esale_menus
if website == menu.website and menu.active == True]
class Product(metaclass=PoolMeta):