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

I need to update sales order statuses.
Add new states and buttons.


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

Hi,

You can use the selection_add attribute to add new values into the existing selection field. You should inherit the sale.order model and add the new state to the existing selection field.


eg:_inherit = 'sale.order'
state = fields.Selection(selection_add=[('c', 'C'), ('d', 'D')])

Here's a video for your reference:https://www.youtube.com/watch?v=wsf0y_2AVP8&ab_channel=CybrosysTechnologies

To add button and to call function when clicked, you can refer this video:https://www.youtube.com/watch?v=IPJwnFNb6RQ

Hope it helps

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

Thanks for your comment.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 23
1498
3
thg 8 25
2516
1
thg 5 25
2593
1
thg 4 25
3555
1
thg 4 25
4408