I want to display the field from payroll.adjustment.lines which is employee_id and display it from the tree view of payroll.adjustment model. Is it possible? They have relation.
from payroll.adjustment model
adjustment_lines =
fields.One2many('payroll.adjustment.lines','adj_id',string="Adjustment
lines")
from payroll.adjustment.lines model
adj_id = fields.Many2one('payroll.adjustment',string="Payroll
Adjustment",ondelete='cascade')
and in my xml
<record id="payroll_adjustment_tree_view" model="ir.ui.view">
<field name="name">payroll_adjustment.tree</field>
<field name="model">payroll.adjustment</field>
<field name="arch" type="xml">
<tree string="Payroll Adjustment" colors="red:state ==
'void';green:state == 'draft';blue:state=='confirm'">
<field name="doc_num"/>
<field name="company_id"/>
<field name="adjustment_lines"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="state"/>
</tree>
</field>
</record>
the
<field name="adjustment_lines"/>
only display (2 records) not the employee name. Please help me guys. Thanks
I tried the answered below and this is the result. The employee name displaying false
and this is my tree view where i called the field from lines and display it to tree view from my payroll.adjustment model.
and this is the output of my tree view and it only shows (records)