# Contact selection without party\_relationship module

**URL:** https://discuss.tryton.org/t/contact-selection-without-party-relationship-module/3815
**Category:** Ideas
**Created:** [February 15, 2021, 11:10am UTC](https://discuss.tryton.org/t/contact-selection-without-party-relationship-module/3815 "2021-02-15T11:10:58Z")
**Posts on this page:** 3
**Page:** 1

<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: [February 15, 2021, 11:10am UTC](https://discuss.tryton.org/t/contact-selection-without-party-relationship-module/3815/1 "2021-02-15T11:10:58Z")

</div>

Some time ago [we added the contact on orders](https://discuss.tryton.org/t/add-contact-and-invoice-party-on-orders/1813). This field allows to select any contact on the database and when using the party\_relationship the [contacts are sorted based on the distance between the parties](https://bugs.tryton.org/issue5853).

We have some users that are not using the party\_relationship module and for them all the contacts of the database are shown without any order. I’m wondering if we would have a simple sorting for this kind of users: “Contacts from same party shold shown first” and other contacts latter.

Toughts?

---

<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: [February 15, 2021, 1:24pm UTC](https://discuss.tryton.org/t/contact-selection-without-party-relationship-module/3815/2 "2021-02-15T13:24:27Z")

</div>

Indeed this is exactly the notion of distance that `party_relationship` introduce.  
Maybe it could be doable to integrate part of it in the `party` module.

---

<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: [February 15, 2021, 5:12pm UTC](https://discuss.tryton.org/t/contact-selection-without-party-relationship-module/3815/3 "2021-02-15T17:12:48Z")

</div>

I filled [Basic distance calculation for parties (#10104) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue10104) which implements a basic distance calculation on party module by just returing a zero distance for the current party (and None for all others)
