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


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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM