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

CelineGeorge1 740 views 7 slides Jul 03, 2024
Slide 1
Slide 1 of 7
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7

About This Presentation

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...


Slide Content

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

Introduction Enterpr ise 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. r ecord 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