summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-08-26 13:45:44 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-09-04 11:33:39 +0000
commitd132bce45997d7e38c03538db762b07b99a893fc (patch)
tree021e052ff3a39d7dfaa12ff991fb2d1baa0d753b /addons
parentefc0263b2574fa355ea794514eb3285d8c449260 (diff)
[FIX] portal,project: allow other company users to correctly access my/tasks page
In multi-company configuration setup, Company A and Company B. Have a project in Company A that I want to share with a user in Company B. The user only has access to Company B. Share using the project link and open using the user Traceback error will raise. Adding a default value to retrieve in case the filter option is used but the user has no permissions on the records. opw-2322236 closes odoo/odoo#57087 X-original-commit: bcb62e8f6e20bccc2f2350bdc1268c495b7103da Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com> Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/portal/views/portal_templates.xml2
-rw-r--r--addons/project/controllers/portal.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/portal/views/portal_templates.xml b/addons/portal/views/portal_templates.xml
index 02a8d10301b..75827fe8ac9 100644
--- a/addons/portal/views/portal_templates.xml
+++ b/addons/portal/views/portal_templates.xml
@@ -262,7 +262,7 @@
<span class="small mr-1 navbar-text">Filter By:</span>
<div class="btn-group">
<button id="portal_searchbar_filters" data-toggle="dropdown" class="btn btn-secondary btn-sm dropdown-toggle">
- <t t-esc="searchbar_filters[filterby].get('label', 'All')"/>
+ <t t-esc="searchbar_filters.get(filterby,searchbar_filters.get('all')).get('label', 'All')"/>
</button>
<div class="dropdown-menu" aria-labelledby="portal_searchbar_filters">
<t t-foreach="searchbar_filters" t-as="option">
diff --git a/addons/project/controllers/portal.py b/addons/project/controllers/portal.py
index e80aaa647e2..43147037d2b 100644
--- a/addons/project/controllers/portal.py
+++ b/addons/project/controllers/portal.py
@@ -151,7 +151,7 @@ class CustomerPortal(CustomerPortal):
# default filter by value
if not filterby:
filterby = 'all'
- domain = searchbar_filters[filterby]['domain']
+ domain = searchbar_filters.get(filterby, searchbar_filters.get('all'))['domain']
# default group by value
if not groupby: