Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4387 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Autor

Thank you for the answer it worked!

Related Posts Odpovědi Zobrazení Aktivita
2
čvn 23
2931
4
led 22
6562
1
bře 15
4512
0
bře 23
1221
1
dub 22
5853