Skip to content
Snippets Groups Projects
Unverified Commit 8cbd29f6 authored by Joren Van Onder's avatar Joren Van Onder
Browse files

[FIX] mrp: display attachment image in mrp.document kanban view

Before this the mrp.document id was used to construct the /web/image/
link which lead to the wrong attachment being previewed and
downloaded. Introduced by the refactoring that happened in
d193350c.
parent ca258b86
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
<field name="model">mrp.document</field>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="ir_attachment_id"/>
<field name="mimetype"/>
<field name="type"/>
<field name="datas_fname"/>
......@@ -19,11 +19,11 @@
<div class="oe_attachment">
<div class="row">
<div class="col-xs-4 o_kanban_primary_left" t-if="record.type.raw_value == 'binary'">
<a t-attf-href="/web/content/#{record.id.raw_value}?download=1">
<a t-attf-href="/web/content/#{record.ir_attachment_id.raw_value}?download=1">
<t t-set="webimage" t-value="new RegExp('image.*(gif|jpeg|jpg|png)').test(record.mimetype.value)"/>
<div t-if="!webimage" class="o_image" t-att-data-mimetype="record.mimetype.value"/>
<div t-if="webimage" class="o_attachment_image">
<img t-attf-src="/web/image/#{record.id.raw_value}?download=1"/>
<img t-attf-src="/web/image/#{record.ir_attachment_id.raw_value}?download=1"/>
</div>
</a>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment