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.在要加入事件的控件 ...
随机推荐
- 【转】如何用 Chrome for Android 做远程遥控 debugging
http://blog.csdn.net/wuchengzhi82/article/details/22190435
- 【转】solr+ajax智能拼音详解---solr跨域请求
本文转自:http://blog.csdn.net/wangzhaodong001/article/details/8529090 最近刚做完solr的ajax智能拼音.总结一下. 前端:jQuery ...
- codeforces 459C Pashmak and Buses 解题报告
题目链接:http://codeforces.com/problemset/problem/459/C 题目意思:有 n 个 students,k 辆 buses.问是否能对 n 个students安 ...
- 如何在Win8系统上建立WIFI热点
1.首先将鼠标移到桌面左下角,单击右键,在弹出的快捷菜单中找到“命令提示符(管理员)”,点击 2.点击后,系统就以管理员权限打开了命令提示符,在命令提示符中输入以下命令“netsh wlan set ...
- tomcat The file is absent or does not have execute permission
[root@centos02 bin]# ./startup.sh Cannot find ./catalina.sh The file is absent or does not have exec ...
- hdu 2044:一只小蜜蜂...(水题,斐波那契数列)
一只小蜜蜂... Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission(s): Accepte ...
- Android开发代码规范(转)
Android开发代码规范 1.命名基本原则 在面向对象编程中,对于类,对象,方法,变量等方面的命名是非常有技巧的.比如,大小写的区分,使用不同字母开头等等.但究其本,追其源,在为一个资源其名称 ...
- SQLite使用方法 SQLiteOpenHelper操作(转)
SQLiteOpenHelper主要用于 创建数据库 SQLiteDatabase 主要用于 执行sql语句 程序内使用SQLite数据库是通过SQLiteOpenHelper进行操作 1. ...
- 建模算法(一)——线性规划
一.解决问题 主要是安排现有资源(一定),取得最好的效益的问题解决,而且约束条件都是线性的. 二.数学模型 1.一般数学模型 2.MATLAB数学模型 其中c,x都是列向量,A,Aeq是一个合适的矩阵 ...
- 使用 Docker 建立 Mysql 集群
软件环境介绍操作系统:Ubuntu server 64bit 14.04.1Docker 版本 1.6.2数据库:Mariadb 10.10 (Mariadb 是 MySQL 之父在 MySQL 被 ...