Skip to Content
Menu
This question has been flagged
1 Reply
1502 Views

I'm trying to intercept the values when they are getting created but it seems this function is not getting called


@api.model
def create(self, vals):
print("gets called")
new_reservation = super(HotelReservation, self).create(vals)

# do some things here

return new_reservation
Avatar
Discard
Best Answer

Is you model a inherited ones or new custom model ? If you are creating a new model, do make sure you have assigned security rules permission of create, write, delete and update in ir.model.access.csv. In Odoo 12, you would simply define the create() method without any specific decorator.

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 23
1879
2
Nov 20
4456
2
Dec 23
14788
0
Oct 23
33
3
Oct 23
788