[IMP]: Added Upstream patch for Portal

This commit is contained in:
Hansa Rathod 2018-07-10 17:25:25 +05:30
parent 86f95ea592
commit f4ba553e51
2 changed files with 17 additions and 1 deletions

View File

@ -100,7 +100,7 @@ class PortalChatter(http.Controller):
raise Forbidden() raise Forbidden()
# Non-employee see only messages with not internal subtype (aka, no internal logs) # Non-employee see only messages with not internal subtype (aka, no internal logs)
if not request.env['res.users'].has_group('base.group_user'): if not request.env['res.users'].has_group('base.group_user'):
domain = expression.AND([['&', '&', ('subtype_id', '!=', False), ('subtype_id.internal', '=', False)], domain]) domain = expression.AND([['&', ('subtype_id', '!=', False), ('subtype_id.internal', '=', False)], domain])
Message = request.env['mail.message'].sudo() Message = request.env['mail.message'].sudo()
return { return {
'messages': Message.search(domain, limit=limit, offset=offset).portal_message_format(), 'messages': Message.search(domain, limit=limit, offset=offset).portal_message_format(),

View File

@ -10,6 +10,7 @@
is_website_user: <t t-esc="json.dumps(request.env.user._is_public())"/>, is_website_user: <t t-esc="json.dumps(request.env.user._is_public())"/>,
user_id: <t t-esc="json.dumps(request.env.user.id)" />, user_id: <t t-esc="json.dumps(request.env.user.id)" />,
is_frontend: true, is_frontend: true,
translationURL: '/website/translations',
}; };
</script> </script>
@ -194,6 +195,21 @@
</li> </li>
</ul> </ul>
</div> </div>
<div t-if="searchbar_groupby" class="dropdown pull-right mr4">
<button id="portal_searchbar_groupby" class="o_portal_search_panel_fixed_width btn btn-default" type="button" data-toggle="dropdown">
<span class="fa fa-bars fa-lg" />
<span class='hidden-xs hidden-sm hidden-md' t-esc="searchbar_groupby[groupby].get('label', 'None')"/>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="portal_searchbar_groupby">
<li t-foreach="searchbar_groupby" t-as="option" t-att-class="groupby == option and 'active'">
<a t-att-href="default_url + '?' + keep_query('*', groupby=option)">
<span t-esc="searchbar_groupby[option].get('label')"/>
</a>
</li>
</ul>
</div>
</template> </template>
<template id="portal_contact" name="Contact"> <template id="portal_contact" name="Contact">