summaryrefslogtreecommitdiff
path: root/addons/website_project/controllers/main.py
diff options
context:
space:
mode:
authorfwi-odoo <fwi@odoo.com>2016-10-27 16:35:36 +0200
committerJérome Maes <jem@openerp.com>2017-03-23 14:50:32 +0100
commit936b215adffd2cb58c0c440d28dfe10adbffffe5 (patch)
tree39ecadd42f4a0ccc3726f30df300fa4378bc48e4 /addons/website_project/controllers/main.py
parentce72152679b242476ecec65779f85a2d792cb2f7 (diff)
[IMP] website_portal: hide menu when no documents available
This commit impact website_portal, website_portal_sale, website_project, website_project_issue, and website_crm_partner_assign. The idea is to hide menu items and dashboard entry in customer portal when there no document available. Only Sales Orders and Opportunities are always displayed to avoid empty dashboard. Also, resequence menu items to be more consistent and to prepare to insert more items in the future.
Diffstat (limited to 'addons/website_project/controllers/main.py')
-rw-r--r--addons/website_project/controllers/main.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/addons/website_project/controllers/main.py b/addons/website_project/controllers/main.py
index f778124aa85..ca718f775fb 100644
--- a/addons/website_project/controllers/main.py
+++ b/addons/website_project/controllers/main.py
@@ -11,14 +11,13 @@ from odoo.addons.website_portal.controllers.main import website_account, get_rec
class WebsiteAccount(website_account):
- @http.route()
- def account(self, **kw):
- response = super(WebsiteAccount, self).account(**kw)
- response.qcontext.update({
+ def _prepare_portal_layout_values(self):
+ values = super(WebsiteAccount, self)._prepare_portal_layout_values()
+ values.update({
'project_count': request.env['project.project'].search_count([('privacy_visibility', '=', 'portal')]),
'task_count': request.env['project.task'].search_count([('project_id.privacy_visibility', '=', 'portal')])
})
- return response
+ return values
@http.route(['/my/projects', '/my/projects/page/<int:page>'], type='http', auth="user", website=True)
def my_projects(self, page=1, date_begin=None, date_end=None, sortby=None, **kw):