This question has been flagged
2 Replies
8848 Views

I have a custom module that had a kanban view. His model inherits from res.users (and res.users inherits from res.partner).

I have a problem when I try to access to kanban view of my module. I know where is the error, but i don´t have idea for how to solve. The error is:

Error: QWeb2 - template['kanban-box']: Runtime Error: TypeError: dict.record.id is undefined

This is my kanban view (maestro):

<record model="ir.ui.view" id="maestro_kanban_view">
    <field name="name">maestro.kanban.view</field>
    <field name="model">aula10.maestro</field>
    <field name="groups_id" eval="[(4, ref('grupo_maestros'))]"/>
    <field name="arch" type="xml">
        <kanban>
            <field name='name'/>
            <field name='image'/>
            <templates>
                <t t-name="kanban-box">
                    <div class="oe_kanban_global_click">
                        <div class="o kanban_image">
                            <img t-att-src="kanban_image('maestro','image_medium', record.id.value)"/>
                            <div class="oe_kanban_details">
                                <!-- Title and Data content -->
                                <h4>
                                    <a type="open">
                                        <field name="name"/>
                                    </a>
                                </h4>
                            </div>
                        </div>
                    </div>
                </t>
            </templates>
        </kanban>
    </field>
</record>

I know the problem is in the image, in record.id.value, because when I erase the img tag, the error disappear.

How can I fix this?

Avatar
Discard
Best Answer

update your image div as:

<div class="o_kanban_image">
<t t-if="record.image.raw_value">
<img t-att-src="kanban_image('your model name', 'image_medium', record.id.value)"/>
</t>


Avatar
Discard
Best Answer
<img t-att-src="kanban_image('maestro','image_medium', record.id.value)"/>

from this img tag pls change "record.id.value" to "record.your unique id.value" like  record.auto_rec_id.value

Avatar
Discard