Exporting all parties along with the ID of their parent

I’m trying to import all of our parties into PipeDrive. PipeDrive needs them sorted into a csv of organizations, and a csv of contacts.
For us, this should be feasible simply by filtering “parties which have no parent” (= organization) and “parties which have one parent” (= contact). I’m not sure if this filtering can be made directly in Tryton, but at the very least, if I could export a csv of all parties with a column for the ID of their parent, I could then to that filtering in a spreadsheet and produce the two required csv.

In the export feature, I have found how to include all relations in the csv, but they appear on separate rows under a party. Is there a way to have the party name and its parent ID as two columns of the same row?

Thanks :slight_smile:

As far as you have the parent field on the tree view you will be able to perform this filter from the client. You should use:

Parent: =

To search all parties without parent.

Parent: !=

To search all parties with a parent.

This is because you are exporting the one2many field of the relation.

Yes, you should select two fields: Name and Parent/ID

Parent should be the Many2One field of your realtion.

Hope it helps!

As far as you have the parent field on the tree view you will be able to perform this filter from the client.

I’m sorry I don’t understand what that means. I know how to search using filters, but I don’t see any “Parent” filter field. Do you have a screenshot of where that field should appear? I’m testing on 5.6

Yes, you should select two fields: Name and Parent/ID
Parent should be the Many2One field of your realtion.

I don’t see Parent/ID in the list of fields when trying to export a party. I don’t see a “Parent” category of fields either, only “Relations”.

There is no parent field on Party.
Tryton is not designed to have a tree structure of parties (because it is not how the world is). There is the module party_relationship which allow to define relations between parties but any kind of relations. Also a parties can be in relation which many other parties so there is not a single parent-children relation.

I think you have first to define what you want to export based on the data model of Tryton.