Variant of field type one2many and many2many for sorted associationsby Swing Entwicklung betrieblicher Informationssysteme GmbH
Variant of field type one2many for sorted associations
In the example above, the primary sort criteria is "name" (not case-sensitive), the secondary is "title". Only partners that are physical persons (not is_company) are selected - and only those can be added.
Another possibility is to define a text-property with naming convention "<obj>.<field>.order" (in the example above this would be "res.partner.parent_id.order"). The value of this property is the sort criteria.
The advantage of properties is, that they can by company-individual.
A third possibility is to hand over a "context" key named "one2many_sorted_order" that contains the name of a property.
If no "context" key is found, then the property with the naming convention is taken. If no property is defined, the programmed sort order is taken. Otherwise no sorting takes place.
many2many_sorted has a similar syntax but without search feature.
Note that it works on translated term, not only the text stored in the DB !
Please log in to comment on this module
- This section is meant to ask simple questions or leave a rating.
- This author can leave a single reply to each comment.
- If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.