Enhancing tree view and filter function in client


we have the requirement to show the customer payment terms within the list of parties.

Now, I enhance the party module and add the customer_payment_term to the tree-view XML.
After update and restart, the field is shown correctly. But: Filtering and ordering within the client is not possible.

I am wondering, where I can set this properties, but I did not find any hint in the documentation.

The field is reused from the account_invoice module.

Thank you and best regards,

Is it a function field ?
In this case you have to define an order method for this field : def order_fieldname…
and a searcher.
See example: modules/purchase_request_quotation: 1789591561e2 purchase.py

customer_payment_term is a MultiValue field so it is like a Function field.
MultValue fields do not implement searcher nor order method because they are too much complex due to the generic pattern matching.
An option is to not use the MultiValue field but show the One2Many payment_terms fields but it will require to add ModelView class to the target.

Hi @hbrandes ! I’m kind of doing the same now on How to include a search filter by sales invoice period group ( get default value of Selection Field ) Tryton v5.2. Did you manage to find out how to do it ? :slight_smile: