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
和模板文件,我很想知道这个问题,我已经添加了它们