Enable Dark Mode!
overview-of-list-view-attributes-in-odoo-19.jpg
By: Anaswara S Sunil

Overview of List View Attributes in Odoo 19

Technical Odoo 19 Views

Odoo provides a variety of powerful view types, such as Kanban, Form, Graph, List, Pivot, Search, and Calendar, each designed to offer a smooth and efficient user experience.

In this blog, we will explore how to create a list view in Odoo 19 and walk through all the available list-view attributes, along with examples and expected results.

1. Create a New Model (class.teacher)

# -*- coding: utf-8 -*-
from odoo import fields, models

class ClassTeacher(models.Model):
   _name = 'class.teacher'
   _description = 'Class Teacher'
   name = fields.Char(string='Name')
   age = fields.Float(string='Age')
   email = fields.Char(string='Email')
   subject = fields.Char(string='Subject')
   qualification = fields.Char(string='Qualification')
   experience = fields.Float(string='Experience')
   state = fields.Selection([
       ('draft', 'Draft'),
       ('confirm', 'Confirmed')
   ], string='State')
   joining_date = fields.Date(string='Joining Date')

2. Create Action for class.teacher

Odoo 18+ and Odoo 19 use <list> as the root element instead of <tree>.

<odoo>
   <record id="student_action_teacher" model="ir.actions.act_window">
       <field name="name">Teachers</field>
       <field name="type">ir.actions.act_window</field>
       <field name="res_model">class.teacher</field>
       <field name="view_mode">list,form</field>
   </record>

3. Create the List View

<record id="class_teacher_view_list" model="ir.ui.view">
   <field name="name">class.teacher.view.list</field>
   <field name="model">class.teacher</field>
   <field name="arch" type="xml">
       <list string="Teachers">
           <field name="name"/>
           <field name="age"/>
           <field name="email"/>
           <field name="joining_date"/>
           <field name="subject"/>
           <field name="qualification"/>
           <field name="state"/>
       </list>
   </field>
</record>

Overview of List View Attributes in Odoo 19-cybrosys

List root attributes:

All attributes from Odoo 18 still exist in Odoo 19, with improved UI and behavior.

Below are the detailed explanations.

1. string (str)

The view title is displayed when the action has no name.

<list string="Teachers">

2. create (bool)

Allow or restrict record creation. Default = True.

<list string="Teachers" create="0">

Result: User cannot create records from the list view. There won’t be a NEW button.

Overview of List View Attributes in Odoo 19-cybrosys

3. edit (bool)

Disable editing from list view.

<list string="Teachers" edit="0">

4. delete (bool)

Disable record deletion from Action menu.

Overview of List View Attributes in Odoo 19-cybrosys

<list string="Teachers" delete="0">

Overview of List View Attributes in Odoo 19-cybrosys

5. import (bool)

Disable CSV/XLS import.

Overview of List View Attributes in Odoo 19-cybrosys

<list string="Teachers" import="0">

Overview of List View Attributes in Odoo 19-cybrosys

6. export_xlsx (bool)

Disable export to Excel.

Overview of List View Attributes in Odoo 19-cybrosys

<list string="Teachers" export_xlsx="0">

Overview of List View Attributes in Odoo 19-cybrosys

7. editable (str)

Enable inline row editing and row-based creation.

Options:

  • top
  • bottom
<list string="Teachers" editable="bottom">
Overview of List View Attributes in Odoo 19-cybrosys

Overview of List View Attributes in Odoo 19-cybrosys

8. multi_edit (bool)

Apply one edited value to multiple selected records.

<list string="Teachers" multi_edit="1">

Overview of List View Attributes in Odoo 19-cybrosys

When editing a cell, this dialog appears:

Overview of List View Attributes in Odoo 19-cybrosys

After confirmation, selected records update together.

Overview of List View Attributes in Odoo 19-cybrosys

9. open_form_view (bool)

Adds a small button at the end of each row to open form view.

<list string="Teachers" editable="bottom" open_form_view="1">

Works only when editable is enabled.

Overview of List View Attributes in Odoo 19-cybrosys

10. default_group_by (str)

Automatically groups list by a field.

<list string="Teachers" default_group_by="state">

Overview of List View Attributes in Odoo 19-cybrosys

11. expand (bool)

Expand groups by default.

<list string="Teachers" default_group_by="state" expand="1">

Overview of List View Attributes in Odoo 19-cybrosys

12. default_order (str)

Override _order of the model.

<list string="Teachers" default_order="age desc">

Overview of List View Attributes in Odoo 19-cybrosys

13. limit (int)

Number of records per page.

Default = 80 (list), 40 (x2many).

<list string="Teachers" limit="2">

Overview of List View Attributes in Odoo 19-cybrosys

14. groups_limit (int)

Limit number of visible groups before clicking > "More Groups".

<list string="Teachers" default_group_by="age" groups_limit="2">

Overview of List View Attributes in Odoo 19-cybrosys

15. decoration-<style>

Color-code records based on conditions.

Available styles:

  • decoration-it — italics
  • decoration-bf — bold
  • decoration-danger — light red
  • decoration-primary — purple
  • decoration-info — blue
  • decoration-warning — brown
  • decoration-muted — gray
  • decoration-success — green

Example:

<list string="Teachers"
      decoration-success="state == 'confirm'"
      decoration-info="state == 'draft'">

Overview of List View Attributes in Odoo 19-cybrosys

The List View in Odoo 19 remains one of the most powerful and customizable views available.

Using the above attributes, developers can:

  • Control permissions
  • Enable inline editing
  • Apply batch updates
  • Group & sort data intelligently
  • Apply visual decorations
  • Improve user workflow drastically

To read more about How to Create a List View Attributes in Odoo 18, refer to our blog How to Create a List View Attributes in Odoo 18.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



Recent Posts

whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, KINFRA Techno Park
Kakkanchery, Calicut
Kerala, India - 673635

location

Kochi

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

location

Bangalore

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

Send Us A Message