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()
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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.
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
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 5 21
|
20707 | ||
|
0
thg 9 19
|
3154 | ||
|
0
thg 6 19
|
4494 | ||
|
1
thg 6 18
|
4262 | ||
|
0
thg 3 18
|
3900 |