Some apps, once installed, automatically create a menuitem in website. What complexify the UI and create useless menu withtout plusvalue. It is not because you install livechat to make support online, that you want a link in your menu to show stats e.g. Now we remove the default menu created, and help user to find it when he create a link. The autocomplete suggest most of the main App's controllers task-2189613 closes odoo/odoo#49081 Related: odoo/enterprise#9733 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
22 lines
763 B
Python
22 lines
763 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models, fields, _
|
|
from odoo.addons.http_routing.models.ir_http import url_for
|
|
|
|
|
|
class Website(models.Model):
|
|
_inherit = 'website'
|
|
|
|
def _compute_field_forums_count(self):
|
|
Forum = self.env['forum.forum']
|
|
for website in self:
|
|
website.forums_count = Forum.search_count(website.website_domain())
|
|
|
|
forums_count = fields.Integer(compute=_compute_field_forums_count)
|
|
|
|
def get_suggested_controllers(self):
|
|
suggested_controllers = super(Website, self).get_suggested_controllers()
|
|
suggested_controllers.append((_('Forum'), url_for('/forum'), 'website_forum'))
|
|
return suggested_controllers
|