تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3966 أدوات العرض

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
مايو 22
4477
0
نوفمبر 21
21
0
نوفمبر 21
3606
1
يونيو 21
2826
1
مارس 21
4782