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

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?

Avatar
Hylkää

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

Tekijä

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
toukok. 22
4583
0
marrask. 21
21
0
marrask. 21
3687
1
kesäk. 21
2867
1
maalisk. 21
4832