Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4626 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

Thank you for the answer it worked!

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มิ.ย. 23
3143
4
ม.ค. 22
6764
1
มี.ค. 15
4766
0
มี.ค. 23
1396
1
เม.ย. 22
6047