Does odoo 16 offer the option of sorting the customer list alphabetically in ascending or descending order? In the module res.partner (view_type=list) I can sort the entries by all columns, but not by name. Is this a setting in the configuration or do I have to create a module extension somewhere that then generates a corresponding “Name” field for sorting?
That's because the column is a computed non-stored field and only stored fields can be sorted. So you have atleast to easy possibilities:
class ResPartner(models.Model):
_inherit = "res.partner"
translated_display_name = fields.Char(store=True)
If you use more than one language in Odoo, i wouldn't do that, because otherwise Company invoice, delivery and other addresses without name would never be translated again after saving.
translated_display_name
to display_name
, because the second is already stored in database.