Odoo 16 Development Book

Kanban view

In Odoo we can create several views. such as tree view, form view, list view, kanban view, pivot view, calendar view, etc. The kanban view is a kanban board visualization. It displays records like block”, and we can add images in the kanban. Here we can’t edit the records from the kanban view.

Let's check how to create a new kanban view:

Create a model example.odoo.

class ExampleOdoo(models.Model):
    example_field = fields.Char(string="Example Field")
    example_field1 = fields.Many2one('res.users', 'User', required=True)

After the model is created, we can add the menu and the corresponding menu action for this model

<record id="action_Example" model="ir.actions.act_window">
        <field name="name">Example</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">example.odoo</field>
        <field name="view_mode">kanban,tree,form,graph,pivot</field>
    <menuitem id="example_menu"
            name="Example Odoo"

Now set the kanban view for the model with the corresponding design. Don’t forget to add the required fields.

<record id="example_kanban_view" model="ir.ui.view">
                <field name="name">example</field>
                <field name="model">example.odoo</field>
                <field name="arch" type="xml">
                    <kanban class="o_kanban_mobile" sample="1">
                        <field name="example_field"/>
                        <field name="example_field1"/>
                        <field name="id"/>
                            <t t-name="kanban-box">
                                <div t-attf-class="oe_kanban_global_click">
                                    <div class="o_kanban_image">
                                <img t-att-src="kanban_image('example.odoo', 'example_field', record.id.value)" class="o_image_64_max" height="52"/>
                          <div class="oe_kanban_details">
                              <strong class="o_kanban_record_title">
                              field: <field name="example_field"/>
                          <div t-if="record.example_field1.value">
                                 field1: <t t-esc="record.example_field1.value"/>

The output of the above model is

odoo Development


Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635



Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.



Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message