Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Openerp Odoo-在';创建';一_Openerp - Fatal编程技术网

Openerp Odoo-在';创建';一

Openerp Odoo-在';创建';一,openerp,Openerp,[已解决] <t t-extend="ListView.buttons"> <t t-jquery="button.o_list_button_add" t-operation="after"> <button type="button" class="btn btn-primary btn-sm"> Create Customer Site </button> </t&

[已解决]

<t t-extend="ListView.buttons">
    <t t-jquery="button.o_list_button_add" t-operation="after">
        <button type="button" class="btn btn-primary btn-sm">
            Create Customer Site
        </button>
    </t>
</t>
}

我正在templates.xml中使用您的代码。 也许我必须告诉奥多在哪里使用它吗

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

<t t-extend="ListView.buttons" t-name="add_create_button">
    <t t-jquery="button.o_list_button_add" t-operation="after">
        <button type="button" class="btn btn-primary">
            Create Customer Site
        </button>
    </t>
</t>

</templates>

创建客户站点

要在
创建
按钮后添加它,请使用:

对于
列表视图

<template xml:space="preserve">
    <t t-extend="ListView.buttons">
        <t t-jquery="button.oe_list_add" t-operation="after">
            <!-- Your button here -->
        </t>
    </t>
</template>
<t t-extend="FormView.buttons">
    <t t-jquery="button.oe_form_button_create" t-operation="after">
        <button type="button">My button</button>
     </t>
 </t>
{
    ...

    'depends': ['base'],

    ...
}
\uu openerp\uuuu.py
中向
基本模块添加依赖性:

<template xml:space="preserve">
    <t t-extend="ListView.buttons">
        <t t-jquery="button.oe_list_add" t-operation="after">
            <!-- Your button here -->
        </t>
    </t>
</template>
<t t-extend="FormView.buttons">
    <t t-jquery="button.oe_form_button_create" t-operation="after">
        <button type="button">My button</button>
     </t>
 </t>
{
    ...

    'depends': ['base'],

    ...
}

谢谢你的回答,但它不起作用。我试图将它放在视图或模板文件中,但它没有添加任何内容。@MicheleZaccheddu是否将其添加为qweb模板?我也有。对于ListView,我还尝试将t-jquery更改为“button.o_list_button_add”,就像基本导入模块一样,但还没有任何更改。@MicheleZaccheddu我在
odoo 8
openerp 7
中测试了这段代码,按钮显示在“创建”按钮的旁边。请添加
\u openerp_.py
和模板文件,我很想知道这个问题,我已经添加了它们