summaryrefslogtreecommitdiff
path: root/addons/event/report
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2017-10-09 17:55:42 +0200
committerYannick Tivisse <yti@odoo.com>2017-10-10 10:39:43 +0200
commit1df6f4c74151d012f9ff784cef6eea58a5ac3b9e (patch)
tree4365f3bdcd4aa29d4d8a7fd3816078e3f5ea1746 /addons/event/report
parent707c6b8016f2444494abfed97644b5022305aa05 (diff)
[FIX] ir_actions_report: Render correctly the base64 images in P3
Purpose ======= In python2 a binary field value is retrieved as a string. Example: company_id.logo = u'xyz' In python3 a binary field value is retrieved as a binary. Example: company_id.logo = b'xyz' When trying to render an image on a template, we should pass a stringified version of it. Specification ============= Pass the method to_text in the template rendering context and use it.
Diffstat (limited to 'addons/event/report')
-rw-r--r--addons/event/report/event_event_templates.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/event/report/event_event_templates.xml b/addons/event/report/event_event_templates.xml
index 3f12a45cd42..76b64138f44 100644
--- a/addons/event/report/event_event_templates.xml
+++ b/addons/event/report/event_event_templates.xml
@@ -15,7 +15,7 @@
<div t-field="o.event_id.event_logo"/>
</t>
<span t-if="not o.event_id.event_logo and o.event_id.organizer_id.company_id.logo_web and o.event_id.organizer_id.is_company">
- <img t-att-src="'data:image/png;base64,%s' % o.event_id.organizer_id.company_id.logo_web" style="max-height:1cm; max-width:4cm;"/>
+ <img t-att-src="'data:image/png;base64,%s' % to_text(o.event_id.organizer_id.company_id.logo_web)" style="max-height:1cm; max-width:4cm;"/>
</span>
<h5 t-field="o.event_id.name"/>
<h5>( <i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="o.event_id.date_begin" t-options='{"hide_seconds": True}'> </span> <i>to</i> <span itemprop="endDate" t-field="o.event_id.date_end" t-options='{"hide_seconds": True}'> </span> )</h5>
@@ -65,7 +65,7 @@
<div class="col-xs-12">
<span t-if="event.organizer_id.is_company and event.organizer_id.company_id.logo_web">
<div t-field="event.event_logo">
- <img t-att-src="'data:image/png;base64,%s' % event.organizer_id.company_id.logo_web" style="max-height:1cm; max-width:4cm;"/>
+ <img t-att-src="'data:image/png;base64,%s' % to_text(event.organizer_id.company_id.logo_web)" style="max-height:1cm; max-width:4cm;"/>
</div>
</span>
<h4 t-field="event.name"/>