openerp按钮中的type =“action”的名称(name of type=“action” in openerp button)

编程入门 行业动态 更新时间:2024-10-07 22:23:59
openerp按钮中的type =“action”的名称(name of type=“action” in openerp button)

当我想在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.

更多推荐

本文发布于:2023-07-09 10:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1085528.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按钮   名称   openerp   type   button

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!