コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1522 ビュー

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
アバター
破棄
最善の回答

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.

アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 23
1893
2
11月 20
4475
2
12月 23
14795
0
10月 23
33
3
10月 23
788