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的更多相关文章

  1. TypeError: Error when calling the metaclass bases Cannot create a consistent method resolution

    Python Error when calling the metaclass bases Cannot create a consistent method resolution order (MR ...

  2. Part 57 to 58 Why should you override ToString and Equal Method

    Part 57 Why should you override ToString Method sometimes you can override ToString method like that ...

  3. Java重写父类使用@Override时出现The method destroy() of type xxx must override a superclass method的问题解决

    解决方法: 1.把JDK版本改成1.6以上的. 2.把Compiler改成1.6以上的. 关于这两者的区别,参考:http://www.cnblogs.com/EasonJim/p/6741682.h ...

  4. The method onClick(View) of type new View.OnClickListener(){} must override a superclass

    最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ok —————— 最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ".. ...

  5. [转]NopCommerce How to code my own payment method

    本文转自:http://docs.nopcommerce.com/display/nc/How+to+code+my+own+payment+method Payment methods are im ...

  6. Template Method Design Pattern in Java

    Template Method is a behavioral design pattern and it’s used to create a method stub and deferring s ...

  7. 从虚拟机角度看Java多态->(重写override)的实现原理

    工具与环境:Windows 7 x64企业版Cygwin x64jdk1.8.0_162 openjdk-8u40-src-b25-10_feb_2015Vs2010 professional 0x0 ...

  8. 基础才是重中之重~方法override详解

    回到 目录 之所以写这篇文章,完全是因为这次代码审核,这次代码审核过程当中,出现了很多我认为基础知识不够扎实的问题,所以,打算把它们记录下来,共大家分享. 方法的override,即方法的覆写或者重写 ...

  9. [Python] Create a Django project in Pycharm

    From: http://blog.csdn.net/u013088062/article/details/50158239 From: http://blog.csdn.net/u013088062 ...

随机推荐

  1. Two Sum I & II

    Two Sum I Given an array of integers, find two numbers such that they add up to a specific target nu ...

  2. maven项目 Java compiler level does not match the version of the installed Java project facet

    因工作的关系,Eclipse开发的Java项目拷来拷去,有时候会报一个很奇怪的错误.明明源码一模一样,为什么项目复制到另一台机器上,就会报“java compiler level does not m ...

  3. poj1166

    爆搜就可以过,不过我用了迭代加深. 注意每个操作最多进行4次 #include <cstdio> #include <cstdlib> using namespace std; ...

  4. mysql show

    1.show命令语法 SHOW {BINARY | MASTER} LOGS SHOW BINLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset, ...

  5. hdu 1022 Train Problem I 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022 又是一道栈的练习,这次也是没有用到STL中的栈来实现.用来保存操作过程的数组(process[] ...

  6. CodeForces - 417B (思维题)

    Crash Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status ...

  7. UITableView:下拉刷新和上拉加载更多

    [转载请注明出处] 本文将说明让UIScrollView支持"下拉刷新"和"上拉加载更多"的实现机制,并实现一个可用的tableView子类,以下主要以&quo ...

  8. July 18th, Week 30th Monday, 2016

    Truth needs no color; beauty, no pencil. 真理不需要色彩,美丽无需涂饰. Most of the time, giving some color to trut ...

  9. CUDA学习笔记(二)——CUDA线程模型

    转自:http://blog.sina.com.cn/s/blog_48b9e1f90100fm5b.html 一个grid中的所有线程执行相同的内核函数,通过坐标进行区分.这些线程有两级的坐标,bl ...

  10. MFC添加鼠标相应事件

    Class View (类视图)窗口中选中 你要添加事件的类(比如C***View.CPP),切换到properties窗口. 点击上面的Message图标(在Event图标[一个闪电形状的图标] 右 ...