コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
7717 ビュー

I tried adding some  javascript directly to xml view, in a header, and a simple alert works, but when i try to loop in any way, does not work, throws this message:

Error: Invalid XML: <form string="Mejores Rutas" version="7.0"><header><script type="text/javascript"> var elem = document.getElementByTagName("field"); for(var i=0;i<elem.length;i++){ if(i == 0) { alert("HOLA"); } } </script></header><field name="origen" modifiers="{&quot;required&quot;: true}"/><field name="invoices" string="Facturas para Enviar" widget="one2many" colspan="4" nolabel="1" modifiers="{&quot;required&quot;: true}"/><footer/></form>

http://localhost:8069/web/webclient/js?db=ms:162

Is there any other way of adding js code in openerp?

アバター
破棄
最善の回答

You need to escape the < sign. Use &lt;

アバター
破棄
関連投稿 返信 ビュー 活動
0
7月 25
455
1
7月 25
5471
0
7月 25
1007
0
6月 25
991
1
6月 25
1113