Skip to Content
Menu
This question has been flagged
1 Atsakyti
8780 Rodiniai

Python Code:
        class Test(models.Model):

       _name = "test.test"_name = "test.test" 

        image = fields.Binary(attachment=True)

XML Code:
                <record id = "test_id" model = "ir.ui.view">

                        <field name = "name">Test Image</field>

                        <field name = "model">test.test</field>

                        <field name = "arch" type = "xml">

                        <kanban>

                                    <field name="image" />

                        <templates>

                                <t t-name="kanban-box">

                                <div class="oe_resource_vignette">

                                <div class="oe_resource_image">

                                        <img t-att-src="kanban_image('test.test','image',record.id.raw_value)" class="oe_resource_picture"/>

                              </div>

                            </templates>

            </kanban>

            </field>

      </record>

            

Portretas
Atmesti
Best Answer

Hello sibi0229,


Try below code :

<record id="test_kanban_view" model="ir.ui.view">

    <field name="name">test.test.kanban.view</field>

    <field name="model">test.test</field>

    <field name="arch" type="xml">

        <kanban class="o_kanban_small_column">

            <field name="image"/>

            <templates>

                <t t-name="kanban-box">

                    <div class="oe_kanban_content">

                        <div class="row">

                            <img t-att-src="kanban_image('test.test', 'image', record.id.value)" class="oe_kanban_picture" style="max-height: 90px; max-width: 60px;"/>

                        </div>

                    </div>

                </t>

            </templates>

        </kanban>

    </field>

</record>


Hope it will works for you.

Thanks,

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
vas. 18
4499
0
spal. 17
4963
4
spal. 17
4397
2
bal. 23
10735
1
vas. 20
7694