Rendering images
The last column of our report will feature the list of followers with their avatars. We will use the media-list
Bootstrap component and a loop through the followers to render each one of them:
<!-- Render followers -->
<ul class="media-list">
<t t-foreach="o.message_follower_ids" t-as="f">
<li t-if="f.partner_id.image_small"
class="media-left">
<span t-field="f.partner_id.image_small"
t-options="{'widget': 'image'}"
class="media-object" />
<span class="media-body"
t-field="f.partner_id.name" />
</li>
</t>
</ul>
Using the image
widget takes care of generating the <img>
tag with the proper src
attribute, and expects a base64
image as the value of the t-field
.