There're two commen type of actions in odoo: ir.actions.server,ir.actions.client_multi

1.Using ir.actions.server

  1. <record model="ir.actions.server" id="xxxx">
  2. <field name="name">XXX</field>
  3. <field name="type">ir.actions.server</field>
  4. <field name="model_id" ref="model_XXX"/>
  5. <field name="state">code</field>
  6. <field name="code">self.do_somthing(cr,uid,ids,context)</field>
  7. </record>

2.Using ir.actions.act_window

  1. <record model="ir.actions.act_window" id="xxx">
  2. <field name="name">xxxx</field>
  3. <field name="res_model">xxx.xxx</field>
  4. <field name="view_mode">tree,form</field>
  5. <field name="view_type">form</field>
  6. <field name="view_id" ref="xxx.xxxxx.xxxx">
  7. <field name="target">new</field>
  8. <record>

about is two type of ir.actions. the first one you can execute your own python code at the server side using state type "code". the second one you can call an existing action in client side.

3.how to add button in "more" button list

  1. <record model="ir.values" id="xxxx">
  2. <field name="name"></field>
  3. <field name="model_id" ref="xxx_xxxx">
  4. <field name="model">xxxx</field>
  5. <field name="key">action</field>
  6. <field name="key2">client_action_multi</field>
  7. <field name="value" eval="'ir.actions.act_window,'+str(ref('action_xxx_xx'))"/>
  8. </record>

one more thing .....

the quickest method to create button in more button is like this:

  1. <act_window id="act_qunar_product_expense_merge_wizard" name="Merge Wizard" src_model="product.expense" res_model="product.expense.wizard" key2="client_action_multi" target="new" view_mode="form" multi="True"/>

act_window is one of short format of actions. be careful about your src_model and res_model. src_model determine which model the button attach on,and res_model means which model you are using to attach. if you want to using button in tree view set multi true otherwise set it false.

have fun !

Add Customerlize Button in More Button List In Odoo的更多相关文章

  1. MFC编程入门之二十二(常用控件:按钮控件Button、Radio Button和Check Box)

    本节继续讲解常用控件--按钮控件的使用. 按钮控件简介 按钮控件包括命令按钮(Button).单选按钮(Radio Button)和复选框(Check Box)等.命令按钮就是我们前面多次提到的侠义的 ...

  2. button,input type=button按钮在IE和w3c,firefox浏览器区别

    在项目中遇到一个问题,是关于点击button按钮会自动刷新的问题.查阅了资料,做以下的整理: button,input type=button按钮在IE和w3c,firefox浏览器区别如下:当在IE ...

  3. HTML中button和input button的区别

    button和input button的区别 一句话概括主题:<button>具有<input type="button" ... >相同的作用但是在可操控 ...

  4. VS2010/MFC编程入门之二十二(常用控件:按钮控件Button、Radio Button和Check Box)

    言归正传,鸡啄米上一节中讲了编辑框的用法,本节继续讲解常用控件--按钮控件的使用. 按钮控件简介 按钮控件包括命令按钮(Button).单选按钮(Radio Button)和复选框(Check Box ...

  5. VS2010-MFC(常用控件:按钮控件Button、Radio Button和Check Box)

    转自:http://www.jizhuomi.com/software/182.html 按钮控件简介 按钮控件包括命令按钮(Button).单选按钮(Radio Button)和复选框(Check ...

  6. iOS7(iPhone4)button不能改变button的title

    最近整了个高端的iPhone4测试机,系统是iOS7.1,测出一个问题,两个button,第二个的enable为NO,点击第一个button,第二个的title改变,然而在iPhone4上并不能运行, ...

  7. Material Designer的低版本兼容实现(九)—— Float Button & Small Float Button

    5.0一个新特性就是出现了这么一个圆形的悬浮指示按钮,这个按钮可以用来体现一个全局的重要功能,比如添加账户什么的.这个按钮有两种大小,一种是正常的按钮大小,一种是小型的按钮.官方文档中介绍的是小心的按 ...

  8. 初学ToggleButton 点击button,更换button背景图片;再次点击,恢复之前背景图

    上方的图标,R.drawable.register_checked  是选中图片 下方的图标,   R.drawable.register_unchecked 是未选中图片 默认是上方的选中效果.点击 ...

  9. ListView中加入Button后,Button的点击事件和ListView的点击事件冲突

    1.在ItemView配置的xml文件里的根节点加入属性android:descendantFocusability="blocksDescendants" 2.在要加入事件的控件 ...

随机推荐

  1. sharepoint读取启用了追加功能的多行文本的历史版本记录

    当建立多行文本栏时,有个功能就是"追加对现有文本所做的更改",这个功能启用后,这个多行文本就只运行追加内容而不允许修改以前提交的内容.常常被应用在多个用户之间的协作.问题的追踪等记 ...

  2. Linux系统Shutdown命令定时关机详解

    转自:http://www.bootf.com/490.html Linux系统下的shutdown命令用于安全的关闭/重启计算机,它不仅可以方便的实现定时关机,还可以由用户决定关机时的相关参数.在执 ...

  3. maven项目,导入的jar包,没有包含在pom文件中,install失败

    [INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[ ...

  4. 【动态规划】盖房子(house)--未提交--已提交

    问题 D: 盖房子(house) 时间限制: 1 Sec  内存限制: 64 MB提交: 27  解决: 16[提交][状态][讨论版] 题目描述 FJ最近得到了面积为n*m的一大块土地,他想在这块土 ...

  5. PHP--TP框架----把查询到的数据,显示在模型(模板)里面

    MainController.class.php <?php namespace Home\Controller; use Think\Controller; class MainControl ...

  6. Thread源码分析

    本文为转载,请珍惜别人的劳动成果,注明转载地址:http://www.cnblogs.com/gw811/archive/2012/10/15/2724602.html 1.Runnable接口源码: ...

  7. WIN7实现多人远程一台电脑

    今天查了查网,发现有人说,WIN7可以实现多人远程一台电脑,于是乎我就试了试, 在工作办公室里的局域网里试了试,嘿,成功了,愿与大家分享一下,呵呵! 方法一: 多用户早就能破解了 方法如下:用UE打开 ...

  8. js 抽奖转盘实现

    今天用js实现转盘抽奖功能,从后台返回的值可以固定转盘选择停止的任意位置 实现代码如下: js: <script> , i = ;//auto:时间对象 count:计数器 ,i : 计数 ...

  9. Java Hour 16 来个CURD吧!

    有句名言,叫做10000小时成为某一个领域的专家.姑且不辩论这句话是否正确,让我们到达10000小时的时候再回头来看吧. 突然想到我最近一直在追的小说,作者每天都会更新两章,而且质量挺高.所以从这篇开 ...

  10. PHP描述冒泡排序和快速排序算法

    使用PHP描述冒泡排序和快速排序算法,对象可以是一个数组.使用PHP描述顺序查找和二分查找(也叫做折半查找)算法,顺序查找必须考虑效率,对象可以是一个有序数组.写一个二维数组排序算法函数,能够具有通用 ...