Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
5037 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

Thank you for the answer it worked!

Publications associées Réponses Vues Activité
2
juin 23
3698
4
janv. 22
7123
1
mars 15
5066
0
mars 23
1721
1
avr. 22
6292