[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
This commit is contained in:
Victor Feyens
2020-08-03 07:23:30 +00:00
parent 9004e90ab0
commit 71f3fa991c
5 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class PortalAccount(CustomerPortal):
filterby = 'all'
domain += searchbar_filters[filterby]['domain']
archive_groups = self._get_archive_groups('account.move', domain)
archive_groups = self._get_archive_groups('account.move', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
+2 -2
View File
@@ -46,7 +46,7 @@ class CustomerPortal(CustomerPortal):
order = searchbar_sortings[sortby]['order']
# archive groups - Default Group By 'create_date'
archive_groups = self._get_archive_groups('project.project', domain)
archive_groups = self._get_archive_groups('project.project', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
# projects count
@@ -158,7 +158,7 @@ class CustomerPortal(CustomerPortal):
groupby = 'project'
# archive groups - Default Group By 'create_date'
archive_groups = self._get_archive_groups('project.task', domain)
archive_groups = self._get_archive_groups('project.task', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
+1 -1
View File
@@ -44,7 +44,7 @@ class CustomerPortal(CustomerPortal):
domain = []
archive_groups = self._get_archive_groups('purchase.order', domain)
archive_groups = self._get_archive_groups('purchase.order', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
+2 -2
View File
@@ -60,7 +60,7 @@ class CustomerPortal(CustomerPortal):
sortby = 'date'
sort_order = searchbar_sortings[sortby]['order']
archive_groups = self._get_archive_groups('sale.order', domain)
archive_groups = self._get_archive_groups('sale.order', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
@@ -111,7 +111,7 @@ class CustomerPortal(CustomerPortal):
sortby = 'date'
sort_order = searchbar_sortings[sortby]['order']
archive_groups = self._get_archive_groups('sale.order', domain)
archive_groups = self._get_archive_groups('sale.order', domain) if values.get('my_details') else []
if date_begin and date_end:
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
@@ -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