基本信息:
奥多版本:10.0
模块名:simcard
型号名称:辛卡。辛卡在
在python视图中添加链接链接。在
我的模板文件(模板.xml)公司名称:
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_add" t-operation="replace">
<t t-if="widget.model=='simcard.simcard'">
<button class="btn btn-sm btn-default sync_button" type="button" >Sync</button>
</t>
</t>
</t>
</templates>
我的javascript文件(树状视图_按钮.js)公司名称:
^{pr2}$我的python文件函数(模型.py)公司名称:
def my_function(self):
print 'fooooooooooooooo'
我的视图文件(视图.xml)公司名称:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend" name="tree view menu"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript"
src="simcard/static/js/tree_view_button.js">
</script>
</xpath>
</template>
</data>
</odoo>
我的清单文件:
# -*- coding: utf-8 -*-
{
'name': "simcard",
'summary': """
Store them""",
'description': """
Store them""",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base'],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'views/views.xml',
'views/templates.xml',
],
'qweb': ['static/xml/tree_view_button.xml'],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
'installable': True,
'auto_install': False,
'application': True,
}
“同步”按钮出现在树状图标题中,但当我单击该按钮时,我无法调用函数。我有什么遗漏吗??在
您的js代码中有一些错误,下面的代码应该可以正常工作
相关问题 更多 >
编程相关推荐