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

The new key should not be added at the end. it should be added in the middle.For example, Assume that we have draft,quotation,order in state(selection) field. I need to add new key as 'verification' before 'order' key in selection field.
Any Solution?

Ảnh đại diện
Huỷ bỏ

I think it you need to add in the middle, then you might have to rewrite the field with new selections instead of using selection_add

Câu trả lời hay nhất

Create new class that inherits your base class, overwrite your state fields as below:

state = fields.Selection(selection_add=[('verifcation', 'Verification'), ('order',)])

You can search with 'selection_add' in Odoo base(fields.py), to see more details in Odoo 13.

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

The Selection field accepts a method so provide that method to the selection value create a method and return the values in the order that you want.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
2561
1
thg 7 25
969
1
thg 8 25
1151
0
thg 5 25
1407
2
thg 4 25
3600