Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
4635 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä

Thank you for the answer it worked!

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
kesäk. 23
3151
4
tammik. 22
6780
1
maalisk. 15
4774
0
maalisk. 23
1400
1
huhtik. 22
6052