私は、Webモジュールを構築するためのこのガイドに従おうとしていました: 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);
};
};
openerp .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 ファイルに何かあるはずですか? はいの場合、何ですか?