当我想在type="action"制作按钮时遇到问题,它与type="object"真的不同。 我只想制作可以将一个模块连接到另一个模块的按钮。 它已经在openerp中存在几个type="action"按钮。 我只是想了解这个按钮的"name"功能是什么?
我有一个例子,我在后台销售文件夹中找到了这个xml脚本:
<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脚本,它已经变成:
<button name="278" string="Create Invoice" type="action" states="manual" class="oe_highlight" groups="base.group_user"/>"name"发生了什么? 任何人都可以给我一个type="action"的简单按钮吗?
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?
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"/>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"/>What's happening with the "name"? Can anyone give me a simple button of type="action"?
最满意答案
按钮有三种类型: 对象 , 动作和工作流程 。 工作流程是默认设置。
现在我们来了解这三种类型的含义:
如果要调用以.py文件写入的方法 ,则使用object 。
如果您想调用以.xml文件编写的任何操作 ,则使用操作。 假设你想从按钮单击打开一个向导,那么你可以使用type="action" 。
如果您想调用工作流程,则使用workflow (默认)。
<button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice" type="action">
当单击Create Invoice按钮时,您将看到一个向导。
<button name="278" string="Create Invoice" type="action">这里278是action_view_sale_advance_payment_inv动作的postgresql数据库中的一个ID 。
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 is used if you want to call a method which is written in .py file.
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 (the default) is used if you want to call 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">Here 278 is an ID in postgresql database of action_view_sale_advance_payment_inv action.
更多推荐
发布评论