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

unlink_ids = []
        unlink_product_tmpl_ids = []
        for product in self.browse(cr, uid, ids, context=context):
            
            if not product.exists():
                continue
            tmpl_id = product.product_tmpl_id.id
            
            other_product_ids = self.search(cr, uid, [('product_tmpl_id', '=', tmpl_id), ('id', '!=', product.id)], context=context)
            if not other_product_ids:
                unlink_product_tmpl_ids.append(tmpl_id)
            unlink_ids.append(product.id)
        res = super(product_product, self).unlink(cr, uid, unlink_ids, context=context)
        
        
        self.pool.get('product.template').unlink(cr, uid, unlink_product_tmpl_ids, context=context)
        return res
    def onchange_type(self, cr, uid, ids, type):