跳至内容
菜单
此问题已终结
1 回复
5186 查看

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!

相关帖文 回复 查看 活动
2
6月 23
3861
4
1月 22
7279
1
3月 15
5248
0
3月 23
1832
1
4月 22
6435