Performance issues with party_relationship module

Hi, Im experiencing some issues with the party_relationship module activated.
When defining several relations on a party (around +100), if I try to create a sale for example, to a party which is related to the party with several relations, fields with:

search_context={
          'related_party': Eval('party'),
          }

(shipment_party, incoterm_location…) takes minutes to load records, I guess its directly caused by Party._distance_query but I’m not really sure on how to fix it.
I’m experiencing the issue on a 6.8 server, and I recreated it on the 7.4 demo; creating a sale with the party with id 11, raise:
Error: "[502] Bad Gateway". Try again later. on the client.
Any idea? Thanks.

On the demo server I see no slow down nor gateway errors.

By default the party relationship search for relation up to 7 degrees so if the relationship network is dense and there are a lot of parties, this may be slow as almost all parties will be in relationship with all the parties.

I do.

By default the party relationship search for relation up to 7 degrees

I did not understand this as first and I left this topic to work on other things, I just read it again and find out about Party Relationship Module — Party Relationship module for Tryton
Decreasing the depth solves the problem.
Thanks.

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