Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
7 ตอบกลับ
10592 มุมมอง

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

คำตอบที่ดีที่สุด

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.

ผู้เขียน

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.

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

ผู้เขียน

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.

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
3426
1
ก.พ. 22
3615
2
มี.ค. 24
2521
Add custom fields to sales order แก้ไขแล้ว
7
มี.ค. 21
66924
1
มี.ค. 15
3102