Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
1550 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
feb. 23
1923
2
nov. 20
4505
2
dec. 23
14898
0
okt. 23
33
3
okt. 23
789