summaryrefslogtreecommitdiff
path: root/addons/website_crm_partner_assign
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2020-06-30 17:20:19 +0000
committerVictor Feyens <vfe@odoo.com>2020-08-03 07:23:30 +0000
commit71f3fa991c69af265cb1737eae2b78f20541f0e5 (patch)
tree6a9bcd58512746f8a2d8908eaa719d2c37abbd96 /addons/website_crm_partner_assign
parent9004e90ab0b65398bc0a5302690a188ad2372996 (diff)
[IMP] *: disable unused archive_groups feature in portal
The archive groups feature allows the user to have fast access to records of a given month, under its details information. But since the details section isn't shown anymore on portal sub-pages, the feature is computed for nothing on (most) pages. Removing this computation avoids a read_group call on portal subpages (multiple potential queries). This commit disables the feature until a total removal in master. my_details is only truthy on the /my/account portal page, where no archive_groups is given anyway (and the value is set to True only in the rendered tempate itself). X-original-commit: 40c57fafdd5651a522891ab68affe38933ea5202
Diffstat (limited to 'addons/website_crm_partner_assign')
-rw-r--r--addons/website_crm_partner_assign/controllers/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_crm_partner_assign/controllers/main.py b/addons/website_crm_partner_assign/controllers/main.py
index 714f3e9ea93..314257fe69d 100644
--- a/addons/website_crm_partner_assign/controllers/main.py
+++ b/addons/website_crm_partner_assign/controllers/main.py
@@ -60,7 +60,7 @@ class WebsiteAccount(CustomerPortal):
order = searchbar_sortings[sortby]['order']
# archive groups - Default Group By 'create_date'
- archive_groups = self._get_archive_groups('crm.lead', domain)
+ archive_groups = self._get_archive_groups('crm.lead', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
# pager
@@ -126,7 +126,7 @@ class WebsiteAccount(CustomerPortal):
CrmLead = CrmLead.with_context(active_test=False)
# archive groups - Default Group By 'create_date'
- archive_groups = self._get_archive_groups('crm.lead', domain)
+ archive_groups = self._get_archive_groups('crm.lead', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
# pager