您的位置:首页 > 其它

How to override create,write,unlink method in Odoo v8

2014-12-01 10:59 267 查看
As we all know, Odoo 8 has new api which is different with v7. So how to override the create,write,unlink orm method in odoo 8 way ?

Let see it.

if you want override create method you have to use the model decorator.

@api.model
def create(self,values):
............


if you want override write method ,you are not supposed to use write method,using multi decorator instead.

@api.multi
def write(self,values):
......................


the same with unlink:

@api.multi
def unlink(self):
..............
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: