Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5023 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Thank you for the answer it worked!

Powiązane posty Odpowiedzi Widoki Czynność
2
cze 23
3691
4
sty 22
7112
1
mar 15
5053
0
mar 23
1714
1
kwi 22
6279