diff options
| author | fwi-odoo <fwi@odoo.com> | 2016-10-27 16:35:36 +0200 |
|---|---|---|
| committer | Jérome Maes <jem@openerp.com> | 2017-03-23 14:50:32 +0100 |
| commit | 936b215adffd2cb58c0c440d28dfe10adbffffe5 (patch) | |
| tree | 39ecadd42f4a0ccc3726f30df300fa4378bc48e4 /addons/website_crm_partner_assign/controllers/main.py | |
| parent | ce72152679b242476ecec65779f85a2d792cb2f7 (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_crm_partner_assign/controllers/main.py')
| -rw-r--r-- | addons/website_crm_partner_assign/controllers/main.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/addons/website_crm_partner_assign/controllers/main.py b/addons/website_crm_partner_assign/controllers/main.py index 9edc425e69a..5e69b2a2852 100644 --- a/addons/website_crm_partner_assign/controllers/main.py +++ b/addons/website_crm_partner_assign/controllers/main.py @@ -31,13 +31,15 @@ class WebsiteAccount(website_account): ('type', '=', 'opportunity') ] - @http.route() - def account(self, **kw): - response = super(WebsiteAccount, self).account(**kw) + def _prepare_portal_layout_values(self): + values = super(WebsiteAccount, self)._prepare_portal_layout_values() lead_count = request.env['crm.lead'].search_count(self.get_domain_my_lead(request.env.user)) opp_count = request.env['crm.lead'].search_count(self.get_domain_my_opp(request.env.user)) - response.qcontext.update({'lead_count': lead_count, 'opp_count': opp_count}) - return response + values.update({ + 'lead_count': lead_count, + 'opp_count': opp_count, + }) + return values @http.route(['/my/leads', '/my/leads/page/<int:page>'], type='http', auth="user", website=True) def portal_my_leads(self, page=1, date_begin=None, date_end=None, sortby=None, **kw): |
