Here is my code.
emp.py
from odoo import models, fields, api
class Dept(models.Model):
_name = 'emp.dept'
name = fields.Char('Name')
location = fields.Text(string='Location')
@api.multi def action_employee(self):
pass
class Employee(models.Model):
_name = 'emp.employee'
name = fields.Char('Name')
add = fields.Text(string='Address')
dept = fields.Many2one('emp.dept', 'Department')
emp_view.xml
<record id="dept_kanban_view" model="ir.ui.view">
<field name="name">dept.kanban.view</field>
<field name="model">emp.dept</field>
<field name="arch" type="xml">
<kanban>
<field name='name'/>
<field name='location'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click_edit oe_semantic_html_override oe_kanban_card {{record.group_fancy==1 ? 'oe_kanban_card_fancy' : ''}}">
<div class="oe_dropdown_kanban">
<div class="oe_dropdown_toggle">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<li> <a type="delete">Delete</a> </li>
</ul>
</div>
<div class="oe_clear"></div>
</div>
<div t-attf-class="oe_kanban_content">
<field name='name'/><br/>
<field name='location'/><br/>
<div class="col-xs-6 o_kanban_primary_left">
<button class="btn btn-primary" name="action_employee" type="object">
<span>Employee</span>
</button>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
When i click on Employee button of emp.dept kanban view then i need to list(tree) of employees that perticuler deprtment contains based on emp.employee dept field.
Thanks in advance.