mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 00:32:05 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -0,0 +1,15 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class WebsiteMenu(models.Model):
|
||||
_inherit = 'website.menu'
|
||||
|
||||
def _compute_visible(self):
|
||||
""" Hide '/shop' menus to the public user if only logged-in users can access it. """
|
||||
shop_menus = self.filtered(lambda m: m.url[:5] == '/shop')
|
||||
for menu in shop_menus:
|
||||
menu.is_visible = menu.website_id.has_ecommerce_access()
|
||||
|
||||
return super(WebsiteMenu, self - shop_menus)._compute_visible()
|
||||
Loading…
Add table
Add a link
Reference in a new issue