Impacted versions: 8.0

Steps to reproduce:
- Create a database with demo data
- Go to sales, product categories & attributes, attribute values
- Click on 'attribute' column name

Current behavior:
Attribute values are sorted by attribute database ID

Expected behavior:
Attribute values are sorted by attribute name

addons/product/product.py
if context is None:
            context = {}
        if 'partner_id' in context:
            pass
        return super(product_template, self).name_get(cr, user, ids, context)
    def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
        
        
        if not name or any(term[0] == 'id' for term in (args or [])):
            return super(product_template, self).name_search(
                cr, user, name=name, args=args, operator=operator, context=context, limit=limit)
        template_ids = set()
        product_product = self.pool['product.product']
        results = product_product.name_search(cr, user, name, args, operator=operator, context=context, limit=limit)
        product_ids = [p[0] for p in results]
        for p in product_product.browse(cr, user, product_ids, context=context):
            template_ids.add(p.product_tmpl_id.id)
        while (results and len(template_ids) < limit):
            domain = [('product_tmpl_id', 'not in', list(template_ids))]
            args = args if args is not None else []
            results = product_product.name_search(
                cr, user, name, args+domain, operator=operator, context=context, limit=limit)
            product_ids = [p[0] for p in results]
            for p in product_product.browse(cr, user, product_ids, context=context):
                template_ids.add(p.product_tmpl_id.id)
        
        return super(product_template, self).name_search(
            cr, user, '', args=[('id', 'in', list(template_ids))],
            operator='ilike', context=context, limit=limit)
class product_product(osv.osv):