# M2o dropdown not shows good when creating record in a tree editable

**URL:** <https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728>\
**Category:** Developer\
**Created:** [November 28, 2022, 9:29am UTC](https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728 "2022-11-28T09:29:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shervas](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@shervas](https://discuss.tryton.org/u/shervas)\
**Post date:** [November 28, 2022, 9:29am UTC](https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728/1 "2022-11-28T09:29:57Z")

</div>

Hi,  
I have a treeview editable with many records, and when I want to add a new record, before it’s saved, it’s showed on the bottom, and when I scroll all the way down to fill a m2o the dropdown of the m2o isn’t showed correctly it appears below the form.

 ![image](https://discuss-cdn.tryton.org/uploads/default/original/2X/5/5dea636f7a3b109d66578385750e92e7c9ae355d.png)

When I first scroll down until the last record of the tree to load all records, it looks good, I looked on version 6.0 and when you create a rec in a tree editable, sometimes it’s created below and sometimes above. Is there any way to tell tryton when creating a new rec to show it before it’s saved above or below?, I think that if I make to show it above, the m2o would appear correctly.  
Thanks beforehand.

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [November 28, 2022, 9:48am UTC](https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728/2 "2022-11-28T09:48:24Z")

</div>

Not with Bootstrap 3.4, the [dropdown](https://getbootstrap.com/docs/3.4/components/#dropdowns) is either down or up. But on latest version of Bootstrap, the default behavior is smart to choose the proper direction automatically.  
But on recent version of Tryton, we solved most of those cases by having an order such that new records are inserted on top for editable list.

---

<div class="post-metadata">

**Author:** ![shervas](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@shervas](https://discuss.tryton.org/u/shervas)\
**Post date:** [November 28, 2022, 10:14am UTC](https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728/3 "2022-11-28T10:14:25Z")

</div>

And how could I order my editable list, to make new records insert on top without changing any version?

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [November 28, 2022, 10:29am UTC](https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728/4 "2022-11-28T10:29:01Z")

</div>

You must order by `id` `DESC` or `None` (which is the default).

---

<div class="post-metadata">

**Author:** ![shervas](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@shervas](https://discuss.tryton.org/u/shervas)\
**Post date:** [November 28, 2022, 11:17am UTC](https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728/5 "2022-11-28T11:17:53Z")

</div>

That was. Thanks a lot Cédric!

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [December 28, 2022, 11:18am UTC](https://discuss.tryton.org/t/m2o-dropdown-not-shows-good-when-creating-record-in-a-tree-editable/5728/6 "2022-12-28T11:18:00Z")

</div>

Closed on December 28, 2022, 11:18am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
