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

I'm trying to sort product names (in Warehouse > Products) A to Z or in reverse, but have noticed that they are allover the place.  Has anyone encounter this problem?  Have I missed something?

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

I observed that it sorts before uppercase then lowercase (or inverse). Exemple

1, 2, 3, 4, a, b, c, d, A, B, C, D

Is it the same as you?

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

Each module can integrate its own sort method.

By default "product.template" don't have its own method and inherit osv function _order

By default this function, sort by "name"

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hi Pierre,

Our product list is all over the place, doesn't matter whether it is ascending or descending!  All our product names start with an upper case letter, so I don't think it is the cause of this issue.  The product list goes like this: A, T, B, J, B, T, R, O ...

Pity I couldn't attache a screen image or two, otherwise I would!

Iming

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

Sorting is determined by character encoding of a postgresql database. LC_COLLATE - string sort order, see postgresql manual. Verify your character encoding. If your default character is eg. SQL_ASCII switch it to UNICODE.

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

Not sure how it sorts by default but you can explicitly provide a sort order for each view. Activate developer mode. Then choose "Edit Tree View" and modify it to read: <tree string="Product" default_order="name">

Hope this helps!

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 25
1271
2
ม.ค. 24
2822
0
พ.ย. 23
1594
0
ก.ย. 23
1376
2
ส.ค. 23
4088