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

What i want is easy to understand but weird to ask .

to make it simple , i have a One2many view with fields : sequence ,article ,lot , location ,description , quantity

i want to disable sort by this fields (except sequence) while editing 

just sorted by sequence


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

Hi,

Here you can use the '_order ' attribute of odoo which is used to sort the recordset in list view either in ascending or descending. 

Go to the class definition python code of your co-model of the One2many field, there we can set the attributes _name, _description, _rec_name, etc. Like that, _order can also be given as

_order = "sequence"

If you want to sort in descending order, give

_order = "sequence desc"

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 22
6520
2
thg 10 20
4693
1
thg 4 24
13159
1
thg 10 19
7099
0
thg 8 19
4131