# Many2One fields in a tree view

**URL:** https://discuss.tryton.org/t/many2one-fields-in-a-tree-view/6706
**Category:** Developer
**Created:** [November 15, 2023, 1:08pm UTC](https://discuss.tryton.org/t/many2one-fields-in-a-tree-view/6706 "2023-11-15T13:08:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [November 15, 2023, 1:08pm UTC](https://discuss.tryton.org/t/many2one-fields-in-a-tree-view/6706/1 "2023-11-15T13:08:42Z")

</div>

Hi,

When I add a Many2One field in a tree view, I see in the filter dropdown all the fields of the model linked, so is there a simple way to add them in the tree ?  
I’ve tried field=“fieldofthemany2one.field” but it doesn’t work.

Tks,  
Laurent

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [November 15, 2023, 1:18pm UTC](https://discuss.tryton.org/t/many2one-fields-in-a-tree-view/6706/2 "2023-11-15T13:18:15Z")

</div>

Hi Laurent,

No, you can not add related views on tree view (nor on form view) as only fields from the current model can be shown.

Having said that, you can always create a [Function field](https://docs.tryton.org/projects/server/en/latest/ref/fields.html#function) that gets the value from the related model and shows it on the current model.

You can see an example in this commit:

> **[Add relates to sale and purchase lines from party and product (bdba467502e4)...](https://foss.heptapod.net/tryton/tryton/-/commit/bdba467502e4ba3f1541c47436cf9715330e0c71)**
>
> Business Software Modularity, scalability & security for your business Documentation Contribute

Note that there are more changes if you look carefully you will see that functions fields are added to sales and purchase lines.

Hope this helps!

---

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [November 15, 2023, 1:19pm UTC](https://discuss.tryton.org/t/many2one-fields-in-a-tree-view/6706/3 "2023-11-15T13:19:36Z")

</div>

Thanks for the quick answer, yes I use this method to add them !
