How to do it...

  1. Define a view of the kanban type:
<record id="view_all_customers_kanban" model="ir.ui.view"> 
    <field name="model">res.partner</field> 
    <field name="arch" type="xml"> 
        <kanban> 
  1. List the fields you'll use in your view:
    <field name="name" /> 
    <field name="supplier" /> 
    <field name="customer" />
  1. Implement a design:
   <templates> 
       <t t-name="kanban-box"> 
           <div class="oe_kanban_card"> 
                <a type="open"> 
                    <field name="name" /> 
                </a> 
                    <t t-if="record.supplier.raw_value or 
record.customer.raw_value">
is
<t t-if="record.customer.raw_value">
a customer
</t>
<t t-if="record.customer.raw_value and
record.supplier.raw_value">
and
</t>
<t t-if="record.supplier.raw_value">
a supplier
</t>
</t> </div> </t> </templates>
  1. Close all the tags:
        </kanban> 
    </field> 
</record> 
  1. Add this view to one of your actions. This is left as an exercise for the reader. You will find a full working example in the GitHub example files: https://github.com/PacktPublishing/Odoo-12-Development-Cookbook-Third-Edition.
..................Content has been hidden....................

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