Hello everyone,
I am using Odoo 12 and need to show a field from a related model on a tree view.
Model 1: This is the origin model where I want to grab the field
class OriginModel(models.Model):
_name = 'model1'
desired_field = fields.Char('Desired Field)
Model 2: This is the destination model
class DestinationModel(models.Model):
_name = 'model2'
_description = 'This is where I need to show the related field from model1'
model1_id = fields.Many2one('model1','Origin Model')
Now I need to show the "desired_field" from model1 on a tree view for "model2"
The tree view:
<record id="any_name_tree_view" model="ir.ui.view">
<field name="name">tree view that shows model1 field</field>
<field name="model">model2</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree>
<!-- HOW TO SHOW DESIRED FIELD HERE????? -->
</tree>
</field>
</record>
Thank you all in advance
Regards
PM