This question has been flagged
2 Replies
6082 Views

Hi,

I have a customer page and contact page also. Customer class is having one2many relation with contact class.

Now I want show the contact name in customer kanban view


<templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_global_click o_res_partner_kanban">
                                <div class="o_kanban_tags_section oe_kanban_partner_categories"/>
                                <div class="oe_kanban_details">                                   
                                    <table>
                                       <tr>
                                            <td class="col-sm-5">
                                                <strong class="oe_partner_heading">Customer Name</strong>
                                            </td>
                                            <td>
                                                <field name="name"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="col-sm-5">
                                                <strong>Contact Name</strong>
                                            </td>
                                            <td>
                                                 <field name="contact_ids">
                                                     <form>
                                                         <field name="name"/>
                                                     </form>
                                                 </field>
                                            </td>
                                        </tr>
                                    </table>            
                                </div>
                            </div>
                        </t>
                    </templates>

When i have given like this  I am getting the output as


Customer Name      Sample

Contact Name          (4 records)


How can I view first record name instead of (4 records) ?

Is anyone know?


Avatar
Discard
Best Answer

Hi,

I have found a module in odoo apps which support one2many field in kanban view.

Please refer this link:  https://apps.odoo.com/apps/modules/11.0/web_one2many_kanban/


Avatar
Discard
Best Answer

Dear silpa m s,

I think no directly way to make this, but you can define computed field as char depends on contact_ids and then return the  contacts name on it. After that you can replace contacts_ids by the new field on your kanban view.

I hope i helped you..
Avatar
Discard