콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
7843 화면

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


아바타
취소
관련 게시물 답글 화면 활동
2
5월 21
21617
0
9월 19
3540
0
6월 19
4930
1
6월 18
4778
0
3월 18
4353