SlideShare a Scribd company logo
How to Show Sample
Data in Tree and Kanban
View in Odoo 17
Enterprise
Introduction
Enterprise
In Odoo 17, sample data serves as a valuable resource for
users seeking to familiarize themselves with the
functionalities and capabilities of the software prior to
integrating their own information. In this slide we are going
to discuss about how to show sample data to a tree view and
a kanban view.
Enterprise
Create a new model
● Create a new model student.record and add some fields
to it
Class StudentRecord(models.Model):
_inherit = ‘student.record’
name = fields.Char(‘Student’)
age = fields.Float(‘Age’)
Enterprise
Create tree view for the model
● Define a tree view for the corresponding model
<record id="rental_order_contract_view_tree" model="ir.ui.view">
<field name="name">student.record.view.tree</field>
<field name="model">student.record</field>
<field name="arch" type="xml">
<tree sample=”1”>
<field name="reference_no"/>
<field name="partner_id"/>
</tree>
</field>
</record>
Enterprise
● Adding sample=”1” while defining a view to loading
sample data to the corresponding view type.
● On the creation of new database it will load a sample
data with required fields on the corresponding views
that we have given.
Enterprise
Create kanban view for the model
● Defining a kanban view to add sample
<record id="student_kanban" model="ir.ui.view">
<field name="name">student.kanban</field>
<field name="model">student.record</field>
<field name="arch" type="xml">
<kanban class="school_student_view" string="Student Details" sample="1"> <templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_content">
<strong><div class="oe_kanban_project_list o_kanban_record_subtitle">
<field name="admn_code"/></div></strong>
<div>Student :<field name="name"/></div>
<div>Age:<field name="age"/></div></div></div>
</t>
</templates>
</kanban>
</field>
</record>
For More Info.
Check our company website for related
blogs and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.
Enterprise
www.cybrosys.com

More Related Content

How to Show Sample Data in Tree and Kanban View in Odoo 17

  • 1. How to Show Sample Data in Tree and Kanban View in Odoo 17 Enterprise
  • 2. Introduction Enterprise In Odoo 17, sample data serves as a valuable resource for users seeking to familiarize themselves with the functionalities and capabilities of the software prior to integrating their own information. In this slide we are going to discuss about how to show sample data to a tree view and a kanban view.
  • 3. Enterprise Create a new model ● Create a new model student.record and add some fields to it Class StudentRecord(models.Model): _inherit = ‘student.record’ name = fields.Char(‘Student’) age = fields.Float(‘Age’)
  • 4. Enterprise Create tree view for the model ● Define a tree view for the corresponding model <record id="rental_order_contract_view_tree" model="ir.ui.view"> <field name="name">student.record.view.tree</field> <field name="model">student.record</field> <field name="arch" type="xml"> <tree sample=”1”> <field name="reference_no"/> <field name="partner_id"/> </tree> </field> </record>
  • 5. Enterprise ● Adding sample=”1” while defining a view to loading sample data to the corresponding view type. ● On the creation of new database it will load a sample data with required fields on the corresponding views that we have given.
  • 6. Enterprise Create kanban view for the model ● Defining a kanban view to add sample <record id="student_kanban" model="ir.ui.view"> <field name="name">student.kanban</field> <field name="model">student.record</field> <field name="arch" type="xml"> <kanban class="school_student_view" string="Student Details" sample="1"> <templates> <t t-name="kanban-box"> <div t-attf-class="oe_kanban_card oe_kanban_global_click"> <div class="o_kanban_content"> <strong><div class="oe_kanban_project_list o_kanban_record_subtitle"> <field name="admn_code"/></div></strong> <div>Student :<field name="name"/></div> <div>Age:<field name="age"/></div></div></div> </t> </templates> </kanban> </field> </record>
  • 7. For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com