コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
5109 ビュー

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
3786
4
1月 22
7202
1
3月 15
5162
0
3月 23
1769
1
4月 22
6366