我试图按照这个构建网络模块的指南:https ://doc.openerp.com/trunk/web/module/
我根据指南创建了以下文件:
// static/src/js/first_module.js
openerp.web_example = function (instance) {
instance.web.client_actions.add('example.action', 'instance.web_example.action');
instance.web_example.action = function (parent, action) {
console.log("Executed the action", action);
};
};
开放程序.py
# __openerp__.py
{
'name': "Web Example",
'description': "Basic example of a (future) web module",
'category': 'Hidden',
'depends': ['web'],
'data': ['web_example.xml'],
'js': ['static/src/js/first_module.js'],
}
web_example.xml
<!-- web_example/web_example.xml -->
<openerp>
<data>
<record model="ir.actions.client" id="action_client_example">
<field name="name">Example Client Action</field>
<field name="tag">example.action</field>
</record>
<menuitem action="action_client_example"
id="menu_client_example"/>
</data>
</openerp>
init .py 为空。
现在“示例客户端操作”链接出现在管理面板的顶部栏中,就像它应该出现的那样,但是当我单击它时,我收到一条通知说“找不到客户端操作 example.action”
我已经检查了几次我的代码,以确保它与指南的相似。我只是对一些小错误视而不见,是否存在误解或可能是什么问题?init .py 文件中应该有什么东西吗?如果是,那是什么?