码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-12-01 11:21:23      阅读:1221      评论:0      收藏:0      [点我收藏+]

标签:blog   ar   os   sp   on   div   log   bs   ad   

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):
    ..............

 

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

标签:blog   ar   os   sp   on   div   log   bs   ad   

原文地址:http://www.cnblogs.com/kfx2007/p/4134544.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!