Designing Kanban views

We will improve the library_checkout module we have been working with to add the Kanban view to the library checkouts.

For this, we'll use a new data file, library_checkout/views/checkout_kanban_view.xml. We need to edit the data key in the __manifest__.py  descriptor file to append this new data file at the end of the list.

In library_checkout/views/library_menu.xml, we can find the window action used in the checkout menu item. We need to make a change to it to enable the additional view types we'll add in this chapter:

    <act_window id="action_library_checkout"
name="Checkouts"
res_model="library.checkout"
view_mode="kanban,tree,form,activity,calendar,graph,pivot"
/>

Here, we modify the menu action to include kanban at the beginning of the view_mode list, so that it's the default view mode used. We then add the kanban view record. It's similar to the other views, except that, inside the arch field, we have a <kanban> top XML element.

Next, we can create the actual XML file where our shiny new Kanban view will go, at library_checkout/views/checkout_kanban_view.xml:

<?xml version="1.0"?> 
<odoo>
  
<!-- Add Kanban view --> <record id="library_checkout_kanban" model="ir.ui.view"> <field name="model">library.checkout</field> <field name="arch" type="xml">
<kanban> <!-- Empty for now, but the Kanban will go here! --> </kanban>

</field> </record>
</odoo>

Before starting with the Kanban views, we need to add a couple of fields to the library checkout model.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.156.122