How to sort portal by related record field?
I have 3 tables: 'Part', 'Assembly' and 'AssemblyPart'. AssemblyPart has foreign keys to Part::ID and Assembly::ID, so we can have many assemblies that consist of many parts. On layout Assembly I have a portal to AssemblyParts, one of the fields in the portal is Part::Name from the related table Part.
How can I sort (by using a script) the portal by Part::Name?