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.在要加入事件的控件 ...
随机推荐
- Light OJ 1199 - Partitioning Game (博弈sg函数)
D - Partitioning Game Time Limit:4000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu ...
- JQuery函数库
核心Core 函数$()动态创建由 jQuery 对象包装的 DOM 元素$.unique()去重排序函数$.inArray()在数组中搜索指定的值并返回其索引$.merge()合并数组 属性Para ...
- PHPcms怎么调用二级栏目
{pc:content action=" siteid="$siteid" order="listorder ASC"} {l ...
- WebLogic Exception
访问Weblogic发生以下异常: 2013-08-20 10:15:11 ERROR [ExceptionConvertOnlyFilter] doFilter (line:70) Could no ...
- Java编程语言中sleep()和yield()的区别
转自:http://developer.51cto.com/art/201003/189465.htm 1. Thread.yield(): api中解释: 暂停当前正在执行的线程对象,并执行 ...
- c++find函数用法
头文件 #include <algorithm> 函数实现 template<class InputIterator, class T> InputIterator find ...
- 下面就介绍下Android NDK的入门学习过程(转)
为何要用到NDK? 概括来说主要分为以下几种情况: 1. 代码的保护,由于apk的java层代码很容易被反编译,而C/C++库反汇难度较大. 2. 在NDK中调用第三方C/C++库,因为大部分的开源库 ...
- Android 返回键双击退出程序
/** * 菜单.返回键响应 */ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == K ...
- loadrunner数据库MySQL参数化列表乱码问题
问题现象: 解决方法: 1.配置mysql ODBC数据源里面的编码格式: 2.配置lr创建数据库连接: 3.再次查看:
- HTTPS传输协议原理
我们常常在使用网上银行时看到的连接都是以“https”开始的,那么这个https是什么呢?这其实是表示目前连接使用了SSL进行加密,能保证客户端到服务器端的通信都在被保护起来,那么浏览器是如果实现的呢 ...