类型的名称=“动作";在openerp按钮中 [英] name of type="action" in openerp button
问题描述
我想在type="action"
中创建按钮时遇到问题,与type="object"
确实不同.我只想制作一个可以将一个模块连接到另一个模块的按钮.它在openerp中已经存在type="action"
的几个按钮.我只想了解此按钮的"name"
的功能是什么?
I've a problem when I want to make button in type="action"
, it's really different with type="object"
. I just want to make button that can connect one module to another. It already exists in openerp for a few buttons of type="action"
. I just want to understand what is the function of "name"
of this button?
我有一个例子,我在后端销售文件夹中找到了这个xml脚本:
I have an example, I found this xml script in backend sale folder:
<button name="%(action_view_sale_advance_payment_inv)d"
string="Create Invoice"
type="action"
states="manual"
class="oe_highlight"
groups="base.group_user"/>
当我安装销售模块时,然后在前端sale.order.form
中看到xml脚本,它已经变成:
when I installed sale module, then I see the xml script in frontend sale.order.form
, it's already change into:
<button name="278"
string="Create Invoice"
type="action"
states="manual"
class="oe_highlight"
groups="base.group_user"/>
"name"
怎么了?谁能给我一个简单的type="action"
按钮?
What's happening with the "name"
? Can anyone give me a simple button of type="action"
?
推荐答案
按钮有三种类型:对象,动作和工作流程. 工作流程是默认设置.
There are three kinds of types for button: object, action & workflow. workflow is the default.
现在让我们了解这三种类型的含义:
Now let's understand the meaning of these three types:
-
如果要调用写在
-
object
.
.py
文件中的方法,则使用object
is used if you want to call a method which is written in.py
file.
action
.假设您要通过单击按钮打开向导,则可以使用type="action"
.
action
is used if you want to call any action which is written in .xml
file. Let say if you want to open a wizard from button click then you can use type="action"
.
workflow
(默认设置).
<button name="%(action_view_sale_advance_payment_inv)d"
string="Create Invoice"
type="action">
点击创建发票按钮时,您将看到一个向导.
when Create Invoice button is clicked, you will see a wizard.
<button name="278" string="Create Invoice" type="action">
此处278
是action_view_sale_advance_payment_inv
操作的Postgresql数据库中的 ID .
Here 278
is an ID in postgresql database of action_view_sale_advance_payment_inv
action.
这篇关于类型的名称=“动作";在openerp按钮中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!