Skip to Content
Menú
This question has been flagged
1 Respondre
5014 Vistes

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
Descartar
Best Answer

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
Descartar
Autor

Thank you for the answer it worked!

Related Posts Respostes Vistes Activitat
2
de juny 23
3689
4
de gen. 22
7109
1
de març 15
5048
0
de març 23
1709
1
d’abr. 22
6276