Odoo Help


How to sort products in "Products by categories" by alphabetical ?

Anne-Sylvie Burri
on 11/7/13, 4:45 AM 3,727 views

Hi everybody,

Someone knows how to sort products by alphabetical in "Products by categories" ? When I add _order... in my python file it works only on the total list of products "Products".

Thanks in advance for your help.


Anne-Sylvie Burri
On 11/12/13, 11:27 AM

Thanks for your answer but it doesn't work. Indeed, it's not possible to click on the title "name".

Do you see another solution ? I think I have to modify something in a js file.

Subhin P V
On 11/7/13, 9:07 AM

image description

Is this what you wanted.. ? Here you can See that i clicked on name (column header) And it got sorted in alphabetical Order.

Sorry if i have mistook your requiremet

Thanks for your answer. Unfortunately it's not this list that I wanna sort but the hierarchical tree (where it's possible to click on a category and then the subcategory opens). It's the first screen when you click on the menu "Products by Category".

J.-M. Burri - Bureau ing.-conseils informatique, Anne-Sylvie Burri
on 11/20/13, 3:36 AM
E.R. Spada II
On 3/14/14, 12:54 AM

You need to modify the action and sort by the name, write a small module, like this:

product.py file below from openerp.osv import osv

class product_category(osv.osv):

_inherit = "product.category"
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
    if context is None:
        context = {}
    if context and context.get('order_name', False):
        order = 'name'
    return super(product_category, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count)


XML - product_view.xml <openerp> <data> <record id="product.product_category_action" model="ir.actions.act_window"> <field name="context">{'order_name':True}</field> </record>



About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 11/7/13, 4:45 AM
Seen: 3727 times
Last updated: 3/16/15, 8:10 AM