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

Hello,

I created a button in a new model and trying to change the status bar from status1 to status2 using this button, so I went to server actions and created an action for that by executing a python code. but keeps getting all types of errors.

My question is: what code I should put into this Server Action in order to get executed and the button does its transition

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

Hi,
To change state you don't need to create a server action. you can do it in following way in your python file.
def button_name(self):
      self.write({'state': 'status2'})

Regards

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

Thank you for the answer it worked!

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 6 23
3749
4
thg 1 22
7170
1
thg 3 15
5124
0
thg 3 23
1752
1
thg 4 22
6343