Add Customerlize Button in More Button List In Odoo
There're two commen type of actions in odoo: ir.actions.server,ir.actions.client_multi
1.Using ir.actions.server
<record model="ir.actions.server" id="xxxx">
<field name="name">XXX</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="model_XXX"/>
<field name="state">code</field>
<field name="code">self.do_somthing(cr,uid,ids,context)</field>
</record>
2.Using ir.actions.act_window
<record model="ir.actions.act_window" id="xxx">
<field name="name">xxxx</field>
<field name="res_model">xxx.xxx</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="xxx.xxxxx.xxxx">
<field name="target">new</field>
<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
<record model="ir.values" id="xxxx">
<field name="name"></field>
<field name="model_id" ref="xxx_xxxx">
<field name="model">xxxx</field>
<field name="key">action</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,'+str(ref('action_xxx_xx'))"/>
</record>
one more thing .....
the quickest method to create button in more button is like this:
<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的更多相关文章
- MFC编程入门之二十二(常用控件:按钮控件Button、Radio Button和Check Box)
本节继续讲解常用控件--按钮控件的使用. 按钮控件简介 按钮控件包括命令按钮(Button).单选按钮(Radio Button)和复选框(Check Box)等.命令按钮就是我们前面多次提到的侠义的 ...
- button,input type=button按钮在IE和w3c,firefox浏览器区别
在项目中遇到一个问题,是关于点击button按钮会自动刷新的问题.查阅了资料,做以下的整理: button,input type=button按钮在IE和w3c,firefox浏览器区别如下:当在IE ...
- HTML中button和input button的区别
button和input button的区别 一句话概括主题:<button>具有<input type="button" ... >相同的作用但是在可操控 ...
- VS2010/MFC编程入门之二十二(常用控件:按钮控件Button、Radio Button和Check Box)
言归正传,鸡啄米上一节中讲了编辑框的用法,本节继续讲解常用控件--按钮控件的使用. 按钮控件简介 按钮控件包括命令按钮(Button).单选按钮(Radio Button)和复选框(Check Box ...
- VS2010-MFC(常用控件:按钮控件Button、Radio Button和Check Box)
转自:http://www.jizhuomi.com/software/182.html 按钮控件简介 按钮控件包括命令按钮(Button).单选按钮(Radio Button)和复选框(Check ...
- iOS7(iPhone4)button不能改变button的title
最近整了个高端的iPhone4测试机,系统是iOS7.1,测出一个问题,两个button,第二个的enable为NO,点击第一个button,第二个的title改变,然而在iPhone4上并不能运行, ...
- Material Designer的低版本兼容实现(九)—— Float Button & Small Float Button
5.0一个新特性就是出现了这么一个圆形的悬浮指示按钮,这个按钮可以用来体现一个全局的重要功能,比如添加账户什么的.这个按钮有两种大小,一种是正常的按钮大小,一种是小型的按钮.官方文档中介绍的是小心的按 ...
- 初学ToggleButton 点击button,更换button背景图片;再次点击,恢复之前背景图
上方的图标,R.drawable.register_checked 是选中图片 下方的图标, R.drawable.register_unchecked 是未选中图片 默认是上方的选中效果.点击 ...
- ListView中加入Button后,Button的点击事件和ListView的点击事件冲突
1.在ItemView配置的xml文件里的根节点加入属性android:descendantFocusability="blocksDescendants" 2.在要加入事件的控件 ...
随机推荐
- 【转】Solr安全设置——对外禁用管理后台
本文转自:http://www.devnote.cn/article/94.html 测试于:Solr 4.5.1, Jdk 1.6.0_45, Tomcat 6.0.37 | CentOS 5.7 ...
- 【转】Kettle集群
本文转自:http://blog.csdn.net/dqswuyundong/article/details/5952009 Kettle集群 Kettle是一款开源的ETL工具,以其高效和可扩展性而 ...
- PHP exit() 输出
2014年8月6日 10:41:00 exit($a); 当$a是bool类型,整形的时候,浏览器里是看不到任何输出的 当$a是字符串的时候浏览器里是可以看到输出的 $a = 1; exit($a); ...
- Flash Player 19.0.0.124 Beta + IHTMLDocument3 IHTMLDocument2 ->get_innerHTML
安装 Flash Player 19 之后 有 flash 动画的网页中 IHTMLDocument3 IHTMLDocument2 ->get_innerHTML 获取的 html 内容都是空 ...
- Codebook model 视频抠像 xp sp3 + vs2005 + OpenCV 2.3.1
Codebook model 视频抠像 xp sp3 + vs2005 + OpenCV 2.3.1 源码及详细文档下载 svn checkout http://cvg02.googlecode.co ...
- 使用JS构建简单Map(转)
转载自:http://freejvm.iteye.com/blog/768025 最近使用源生的js处理页面数据,所谓源生的就是指没有经过包装的.最基本的JavaScript代码: 像使用ext,jQ ...
- JavaScript当离开页面时可以进行的操作
当JavaScript离开页面时可以进行的操作 window.onbeforeunload = function() { var email = document.getElementById(&qu ...
- Light OJ 1393 Crazy Calendar (尼姆博弈)
C - Crazy Calendar Time Limit:4000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Su ...
- 自定义Notification
private static void updateProgressNotification(Context cxt, int appsCount, int percent, String appNa ...
- context switches per second 上下文切换
上下文切换对系统来说意味着消耗大量的CPU时间.上下文切换只发生在内核态中.内核态是CPU的一种有特权的模式,在这种模式下只有内核运行并且可以访问所有内存和其它系统资源.