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

I know create an entry like this :

model_obj= self.env['myapp.model']
model_obj.create('name': 'a name')

But how remove an entry ? Is it exist a method like that ?

model_obj.remove()


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
model_obj.unlink()

Review the documentation at:

https://www.odoo.com/documentation/11.0/reference/orm.html#reference-orm-model

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

There are basically three methods which we can override.

  1. Create
  2. Write
  3. Unlink
class Campus(models.Model):
    _name='campus'    
    @api.multi
    def unlink(self,values):
        campus_unlink = super(Campus,self).unlink()
        return campus_unlink

The above code snippet is for unlink or delete an entry.

You can find other methods from here: http://learnopenerp.blogspot.com/2017/11/how-to-override-odoo-functions.html


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 21
21434
0
ก.ย. 19
3429
0
มิ.ย. 19
4836
1
มิ.ย. 18
4647
0
มี.ค. 18
4211