summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/event/report/event_event_templates.xml4
-rw-r--r--addons/hr_attendance/report/hr_employee_badge.xml4
-rw-r--r--addons/stock/report/report_lot_barcode.xml2
-rw-r--r--addons/stock/report/report_package_barcode.xml2
-rw-r--r--addons/web/views/report_templates.xml8
-rw-r--r--addons/website_livechat/views/website_livechat.xml4
-rw-r--r--odoo/addons/base/ir/ir_actions_report.py4
7 files changed, 15 insertions, 13 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"/>
diff --git a/addons/hr_attendance/report/hr_employee_badge.xml b/addons/hr_attendance/report/hr_employee_badge.xml
index 0961d0b178b..cac5c5eee16 100644
--- a/addons/hr_attendance/report/hr_employee_badge.xml
+++ b/addons/hr_attendance/report/hr_employee_badge.xml
@@ -20,12 +20,12 @@
<table style="width:77pt; height:150pt">
<tr style="height:30%">
<td align="center" valign="center">
- <img t-if="employee.company_id and employee.company_id.logo" t-att-src="'data:image/png;base64,%s' % (employee.company_id.logo,)" style="max-height:45pt;max-width:90%" alt="Company Logo"/>
+ <img t-if="employee.company_id and employee.company_id.logo" t-att-src="'data:image/png;base64,%s' % to_text(employee.company_id.logo)" style="max-height:45pt;max-width:90%" alt="Company Logo"/>
</td>
</tr>
<tr style="height:70%;">
<td align="center" valign="center">
- <img t-if="employee.image" t-att-src="'data:image/png;base64,%s' % (employee.image,)" style="max-height:85pt;max-width:90%" alt="Employee Image"/>
+ <img t-if="employee.image" t-att-src="'data:image/png;base64,%s' % to_text(employee.image)" style="max-height:85pt;max-width:90%" alt="Employee Image"/>
</td>
</tr>
</table>
diff --git a/addons/stock/report/report_lot_barcode.xml b/addons/stock/report/report_lot_barcode.xml
index 788c8af9caf..1728782a2ef 100644
--- a/addons/stock/report/report_lot_barcode.xml
+++ b/addons/stock/report/report_lot_barcode.xml
@@ -27,7 +27,7 @@
</table>
</div>
<div class="col-xs-4">
- <img class="image" t-att-src="'data:image/png;base64,%s' % res_company.logo" style="border:auto;"/>
+ <img class="image" t-att-src="'data:image/png;base64,%s' % to_text(res_company.logo)" style="border:auto;"/>
</div>
</div>
<div class="row">
diff --git a/addons/stock/report/report_package_barcode.xml b/addons/stock/report/report_package_barcode.xml
index 3911ba6f907..cdf626547cf 100644
--- a/addons/stock/report/report_package_barcode.xml
+++ b/addons/stock/report/report_package_barcode.xml
@@ -34,7 +34,7 @@
</table>
</div>
<div class="col-xs-4">
- <img class="image" t-att-src="'data:image/png;base64,%s' % res_company.logo" style="border:auto;"/>
+ <img class="image" t-att-src="'data:image/png;base64,%s' % to_text(res_company.logo)" style="border:auto;"/>
</div>
</div>
<div class="row">
diff --git a/addons/web/views/report_templates.xml b/addons/web/views/report_templates.xml
index 0d164a844c2..23b1b71f0a0 100644
--- a/addons/web/views/report_templates.xml
+++ b/addons/web/views/report_templates.xml
@@ -142,7 +142,7 @@
<div class="pull-right">
<h3 class="mt0 text-right" t-field="company.report_header"/>
</div>
- <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" class="pull-left"/>
+ <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % to_text(company.logo)" class="pull-left"/>
<div class="pull-left company_address">
<div>
<strong t-field="company.partner_id.name"/>
@@ -180,7 +180,7 @@
<div class="header o_boxed_header">
<div class="row mb8">
<div class="col-xs-6">
- <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo"/>
+ <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % to_text(company.logo)"/>
</div>
<div class="col-xs-6 text-right mb4">
<h4 class="mt0" t-field="company.report_header"/>
@@ -216,7 +216,7 @@
<div class="header o_clean_header">
<div class="row">
<div class="col-xs-6">
- <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo"/>
+ <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % to_text(company.logo)"/>
</div>
<div class="col-xs-5 col-xs-offset-1" name="company_address">
<ul class="list-unstyled">
@@ -259,7 +259,7 @@
<div class="header">
<div class="row">
<div class="col-xs-3 mb4">
- <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
+ <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % to_text(company.logo)" style="max-height: 45px;"/>
</div>
<div class="col-xs-9 text-right" style="margin-top:22px;" t-field="company.report_header" name="moto"/>
</div>
diff --git a/addons/website_livechat/views/website_livechat.xml b/addons/website_livechat/views/website_livechat.xml
index c43c4294dec..3a0caa340ba 100644
--- a/addons/website_livechat/views/website_livechat.xml
+++ b/addons/website_livechat/views/website_livechat.xml
@@ -126,7 +126,7 @@
<t t-foreach="team" t-as="user" class="media">
<div class="media">
<div class="pull-left" t-if='user.image_small'>
- <img t-att-src="user.image_small and ('data:image/png;base64,' + user.image_small) or '/web/static/src/img/placeholder.png'"
+ <img t-att-src="user.image_small and ('data:image/png;base64,' + to_text(user.image_small)) or '/web/static/src/img/placeholder.png'"
class="img-rounded" t-att-alt="user.name"/>
</div>
<div class="media-body">
@@ -159,7 +159,7 @@
<t t-foreach="channels" t-as="channel">
<div class="media">
<a class="pull-left" t-attf-href="/livechat/channel/#{ slug(channel)}">
- <img t-att-src="channel.image_small and ('data:image/png;base64,' + channel.image_small) or '/web/static/src/img/placeholder.png'" t-att-alt="channel.name" />
+ <img t-att-src="channel.image_small and ('data:image/png;base64,' + to_text(channel.image_small)) or '/web/static/src/img/placeholder.png'" t-att-alt="channel.name" />
</a>
<div class="media-body">
<h4 class="media-heading"><t t-esc="channel.name"/></h4>
diff --git a/odoo/addons/base/ir/ir_actions_report.py b/odoo/addons/base/ir/ir_actions_report.py
index af6f448f839..9451a7ebff4 100644
--- a/odoo/addons/base/ir/ir_actions_report.py
+++ b/odoo/addons/base/ir/ir_actions_report.py
@@ -12,6 +12,7 @@ import time
import base64
import io
import logging
+import odoo
import os
import lxml.html
import tempfile
@@ -465,7 +466,8 @@ class IrActionsReport(models.Model):
user=user,
res_company=user.company_id,
website=website,
- web_base_url=self.env['ir.config_parameter'].sudo().get_param('web.base.url', default='')
+ web_base_url=self.env['ir.config_parameter'].sudo().get_param('web.base.url', default=''),
+ to_text=odoo.tools.pycompat.to_text,
)
return view_obj.render_template(template, values)