Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1514 Vizualizări

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
Imagine profil
Abandonează
Cel mai bun răspuns

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.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
feb. 23
1884
2
nov. 20
4468
2
dec. 23
14793
0
oct. 23
33
3
oct. 23
788