콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4086 화면

I have a button with execution in JS. This button works correctly.
but when adding the code, the other buttons stop working

XML Code:

<record id='module_view_form' model='ir.ui.view'>
<field name="name">module.form</field>
<field name="model">module</field>
<field name="arch" type="xml">
<form>
<header>
<button id="action_addpoint" string="Add point" type="action"/>
</header>
</form>
</field>
</record>

JS Code:

odoo.define('module', function(require){
"use strict";
var form_widget = require('web.FormRenderer');
form_widget.include({
_addOnClickAction: function ($el, node)
{
this._super.apply(this, arguments);
$el.click(function ()
{
if(node.attrs.id === "action_addpoint")
{
alert(""prueba);
}
});
},
});
});

Error:

TypeError: this.do_execute_action(...) is undefined

It should only run on JS.

아바타
취소
작성자

@Ravi Gadnia.

When you add what you indicate, it generates the error

베스트 답변

because you don't call super and inheritance broken. add super call like 

var self = this;
this._super.apply(this, arguments);
$el.click(function () ....

아바타
취소
관련 게시물 답글 화면 활동
0
4월 24
1031
1
3월 15
3995
2
3월 15
9361
2
3월 22
6366
0
3월 15
5262