콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5192 화면

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!

관련 게시물 답글 화면 활동
2
6월 23
3862
4
1월 22
7281
1
3월 15
5248
0
3월 23
1833
1
4월 22
6440