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.在要加入事件的控件 ...
随机推荐
- spring中注解的通俗解释
我们在没有用注解写spring配置文件的时候,会在spring配置文件中定义Dao层的bean,这样我们在service层中,写setDao方法,就可以直接通过接口调用Dao层,用了注解写法后,在配置 ...
- swift init继承问题
当在子类的 designated init方法中不手动调用 父类的 designated init方法时,如果父类有不接受任何参数的init,那么系统会自动调用它,编译器不会报错.但是如果父类中没有不 ...
- iOS 中NSOperationQueue,Grand Central Dispatch , Thread的上下关系和区别
In OS X v10.6 and later, operation queues use the libdispatch library (also known as Grand Central D ...
- web页面版权部分的显示问题
网站开发中绝大部分页面底部都需要版权信息,一般都是Copyright ©域名 2014 - 2015. All Rights Reserved.这种格式,当然也有其他的,有时候不太注意会发现做出的这个 ...
- Java for LeetCode 165 Compare Version Numbers
Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 &l ...
- Ubuntu安装steam游戏平台的解决方案
steam是一个游戏平台,上面提供了很多收费和免费的游戏,在安装的过程中遇到了一些问题,所以把自己遇到的问题及解决方案分享出来供大家参考. 第一步:安装steam平台 sudo apt-get ins ...
- July 17th, Week 30th Sunday, 2016
You are beautiful, but that is not why I love you. 你如此美丽,但我并非因此而爱你. Although we have always been tol ...
- ecshop绕过验证码暴力破解
若验证码不匹配,并没有销毁当前验证码 所以就可以一次请求验证码图片后,只要不再刷新验证码就可以一直使用 1.获取正确的验证码 2. 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
- PhpStorm 配置Xdebug
IDE => Xdebug => Apache(XAMPP) => Firefox + easist Xdebug 1>XAMPP停止apache服务;2>在安装目录下找 ...
- oracle 10g 学习之数据进行增删改查、数据库事务、约束(8)
目标 通过本章学习,您将可以: l 使用 DML 语句 l 向表中插入数据 l 更新表中数据 l 从表中删除数据 l 控制事务 l 描述约束 l 创建和维护约束 数据控制语言 l ...