[FIX] website menu display

This commit is contained in:
Kaushal Prajappati 2018-01-22 11:12:11 +05:30
parent effce68e09
commit 32d5a77281

View File

@ -90,7 +90,7 @@ class Website(models.Model):
def _compute_menu(self): def _compute_menu(self):
Menu = self.env['website.menu'] Menu = self.env['website.menu']
for website in self: for website in self:
website.menu_id = Menu.search([('parent_id', '=', False), ('website_id', '=', website.id), ('menu_view', '!=', False)], order='id', limit=1).id website.menu_id = Menu.search([('parent_id', '=', False), ('website_id', '=', website.id)], order='id', limit=1).id
# cf. Wizard hack in website_views.xml # cf. Wizard hack in website_views.xml
def noop(self, *args, **kwargs): def noop(self, *args, **kwargs):
@ -675,7 +675,7 @@ class Website(models.Model):
@api.multi @api.multi
def get_website_menus(self, website_id): def get_website_menus(self, website_id):
menus = request.env['website.menu'].search([('parent_id', '=', False), ('website_id', '=', website_id)]) menus = request.env['website.menu'].search([('parent_id', '=', False), ('website_id', '=', website_id), ('menu_view', '!=', False)])
if menus: if menus:
return menus return menus