I added a field (Internal Reference) to the Products list view via the GUI interface (Manage Views). Is it possible to make this field sortable via the GUI, or does it require a custom module?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
This is because of product variants and the tree view is a list of product.product objects (variants), that column is a related field on the product.template (the parent product of the variants), you can't by default sort by related fields, so this problem is quite specific to the internal reference on the products list view.
To fix this you need to write a function called _generate_order_by on the product object (or override the product object to add that function)
There is some discussion of it here including some code for a similar field http://stackoverflow.com/questions/15621013/sorting-openerp-table-by-functional-field/15621014
I believe you can add the sort option only in class level, and not GUI level...
nope, it works fine for regular fields, just not functional fields like the default_code field on product.product
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 7 25
|
9108 | ||
|
1
thg 5 25
|
1356 | ||
|
0
thg 1 24
|
1971 | ||
|
1
thg 2 22
|
24272 | ||
Message attachment size limit
Đã xử lý
|
|
5
thg 12 21
|
16986 |