Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4460 Lượt xem

I have two columns that don't appear to be sorting correctly. 

The first (and most serious) is my quantity column. When scrolling through the table, or clicking the column name, the numbers appear to only be sorting within their place (All numbers that start with 1, numbers starting with 2, etc) and this appears within groups

This screenshot might help a bit:

 

The second is the price column. No matter what changes I make to the sort order and direction, I simply can not click the column name to sort by lowest-highest price (or any other sorting for that matter, clicking does nothing)

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

What data type is your quantity column?

From the screenshot, it is left justified, and numeric fields/columns are right justified in Odoo.


Sorting is only supported on regular fields/columns (where the record value is stored in the database).  For products, the following fields/columns are functional (no value is stored in the database - the value is calculated on the fly): cost price, quantity on hand, quantity available.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks for your quick response. The Quantity was stored in the database, but it was a char type. Using http://www.postgresonline.com/journal/archives/29-How-to-convert-a-table-column-to-another-data-type.html, I was able to convert the type to integer without losing my data (or having to go through backing up and restoring the data manually)

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 19
5558
0
thg 11 16
3049
0
thg 10 17
4185
0
thg 5 16
3235
3
thg 4 16
14467