Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1513 มุมมอง

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 23
1883
2
พ.ย. 20
4465
Odoo Mail Sending Limit แก้ไขแล้ว
2
ธ.ค. 23
14790
0
ต.ค. 23
33
3
ต.ค. 23
788