Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
1512 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
helmik. 23
1883
2
marrask. 20
4465
2
jouluk. 23
14790
0
lokak. 23
33
3
lokak. 23
788