Odoo Help

1

Change default sorting without a custom module

By
Joost Schuttelaar
on 2/19/14, 11:50 AM 2,435 views

I want to order my Sales Order and Quotations screens by Customer (versus by Order Number).

Is it possible to make such a change without creating a custom module? For example by editing the action (using the developer mode)? I see that I can easily change the default amount of items shown (limit = 80), but I can't find how to change the default sorting order.

I managed to add an extra field (untaxed amount) to the view by editing the TreeView XML and I would assume it would be possible to change the default sorting in a similar way.

3
Pouya Maleki
On 12/8/15, 6:26 AM

Since odoo 8, you can add tag "default_order" to tree view in xml. The syntax is the same as _order:


<tree string="Foo" default_order="bar,fix desc"> ...


you can also make a custom view and inherit the desired view so it will be update safe:

<tree string="Foo" position ="attributes">
    <attribute name="default_sort">bar,fix desc</attribute>
</tree>

Yep, this works

Limitless Virtual Enterprise, Andre de Kock
on 12/9/15, 1:12 AM
2

Ray Carnes

--Ray Carnes--
16009
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 2/20/14, 11:27 PM

I know of no way to do this without writing a custom module to override the sort order specified in the Python class.

Indeed, there is no way without changing the code. Filters don't record column sorting as of v7.

Fabrice Henrion (fhe)
on 2/21/14, 2:02 AM

Thanks guys. Is there also no way to do this on a per-user setting? Just a way to store the sorting preference? I would even be happy if after clicking on a header column a client-side cookie would be set so that upon revisiting the page the sorting would be the same.

Joost Schuttelaar
on 2/21/14, 5:53 AM

In short: without custom programming it is impossible to record any sorting for anyone anywhere; with custom programming your imagination is the limit.

Fabrice Henrion (fhe)
on 2/21/14, 6:16 AM

Thanks! What a shame :) seems like a good standard feature to have (remember last sorting, client side). What is the best way to suggest new features? I've noticed that the 'Propose New Features' feedback form on openerp.com/community is broken.

Joost Schuttelaar
on 2/21/14, 6:33 AM

The best way to raise awareness regarding new features is to talk to OpenERP sales team.

Fabrice Henrion (fhe)
on 2/21/14, 3:54 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.

Register

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

2 follower(s)

Stats

Asked: 2/19/14, 11:50 AM
Seen: 2435 times
Last updated: 12/8/15, 6:26 AM