Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5001 Представления

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

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Автор

Thank you for the answer it worked!

Related Posts Ответы Просмотры Активность
2
июн. 23
3673
4
янв. 22
7086
1
мар. 15
5043
0
мар. 23
1689
1
апр. 22
6269