Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
1471 Переглядів

Hello,


i have a controller to call for calendar events every couple of minutes for changes but I have the problem that deleted events are of course not in the response. 


Is it possible to send a post call when an event is deleted?


thanks

philipp 

Аватар
Відмінити
Найкраща відповідь

Hello Praxia,

This should be possible, you need to inherit the unlink (delete) function on the calendar event model.

This link explains how to do it: https://www.odoo.com/forum/help-1/how-to-override-unlink-method-if-i-want-to-delete-multiple-records-at-a-time-in-odoo12-155548

So it would be something like this:

@api.multi

def unlink(self):

    # send request to the controller 

    requests.post(endpoint, data=params, headers=headers)

    # call the standard unlink function to delete

    return super(YourClass, self).unlink()

I hope this helps.

Thanks, 

Аватар
Відмінити