Hello, I am having some issues trying to show images in my kanban view. I attach my code below, both, my model and my XML for the kanban view.
Model:
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class Libro(models.Model):
_name = 'libro'
image = fields.Binary(attachment=True)
name = fields.Char(string="Título")
autor = fields.Many2one("autores", string="Autor")
paginas = fields.Integer (string="Número de páginas")
isbn = fields.Char(string="ISBN")
catego = fields.Many2one ("categorias", string="Género")
fecharetirada = fields.Date(string="Fecha de Retirada")
XML:
<record model="ir.ui.view" id="libro_kanban_view">
<field name="name">libro.kanban.view</field>
<field name="model">libro</field>
<field name="type">kanban</field>
<field name="arch" type="xml">
<kanban>
<field name="image"/>
<field name="name"/>
<field name="autor"/>
<field name="isbn"/>
<field name="paginas"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override" style="background-color:#ff8800; border-radius:18px; border: 2px solid #7600d1">
<img t-att-src="kanban_image('libro','image',record.image.value)" class="oe_resource_picture"/>
<div class="oe_kanban_details">
<h4>
<a type="open">
<t><font color="#7600d1"><field name="name"/></font></t> <font color="#a700d1">[<field name="isbn"/>]</font>
</a>
</h4>
<div name="tags"/>
<ul>
<li><font color="#7600d1"><b>Autor:</b></font> <font color="white"><field name="autor"/></font></li>
<li><font color="#7600d1"><b>Número de páginas:</b></font> <font color="white"><field name="paginas"/></font></li>
</ul>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
The thing is that I have seen many people using "record.id.value", but I don't know what it is, and I get an error if use it.
Thanks.