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

I need to run additional commands after the Discard button has been pressed.

I know how to do this with "Save" button:

```
@api.model   
def create(self, vals): 
        # my code before create
        result = super(MODEL_NAME, self).create(vals)
        # my code after create
        return result
```

But I'm unable to find method associated with "Discard" button. How is it called?

아바타
취소

There is no python method behind the discard button. It's a web button to cancel/discard the changes.

작성자

In that case how can I create my custom python method and run it after clicking the button?

관련 게시물 답글 화면 활동
1
5월 22
4859
0
11월 21
21
0
11월 21
3927
1
6월 21
3047
1
3월 21
5032