Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1518 Widoki

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
Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lut 23
1887
2
lis 20
4473
2
gru 23
14794
0
paź 23
33
3
paź 23
788