Skip to content

Commit

Permalink
[FIX] portal: multi-company logo
Browse files Browse the repository at this point in the history
When using:
```
t-field="res_company.logo" t-options="{'widget': 'image'}"
```
the widget generates a `/web/content/` URL, which ultimately checks the
access rights in method `binary_content`. This means that if the user
doesn't have the `read` access rights on `res_company`, the logo won't
be displayed.

We use the `/logo.png` route instead since it bypasses the access
rights.

opw-1913665
  • Loading branch information
nim-odoo committed Dec 19, 2018
1 parent 6be0cde commit c6e6968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/portal/views/portal_templates.xml
Expand Up @@ -28,7 +28,7 @@
<nav class="navbar navbar-expand-md navbar-light bg-light">
<div class="container">
<a href="/" class="navbar-brand logo">
<span t-field="res_company.logo" t-options="{'widget': 'image'}" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name"/>
<img t-att-src="'/logo.png?company=%s' % res_company.id" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name"/>
</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#top_menu_collapse">
<span class="navbar-toggler-icon"/>
Expand Down

0 comments on commit c6e6968

Please sign in to comment.