I have a following function inside JS:
onClickRecruitmentRequest() {
var self = this;
self.do_action({
type: 'ir.actions.act_window',
res_model: 'my.model',
name: 'Request',
view_mode: 'form',
view_type: 'form',
views: [[false, 'form']],
target: 'new',
res_id: false,
});
}
it is called from template on click of the button but it reveals mistake:
TypeError: self.do_action is not a function
at PivotRenderer.onClickRecruitmentRequest (http://127.0.0.1:8069/web/assets/1052-b013586/web.assets_backend.min.js:11991:103)
at extra.handlers. (eval at _compile (http://127.0.0.1:8069/web/assets/897-cf7c985/web.assets_common.min.js:1014:178), :176:183)
at invokeHandler (http://127.0.0.1:8069/web/assets/897-cf7c985/web.assets_common.min.js:838:144)
at handleEvent (http://127.0.0.1:8069/web/assets/897-cf7c985/web.assets_common.min.js:842:92)
at HTMLElement.handler (http://127.0.0.1:8069/web/assets/897-cf7c985/web.assets_common.min.js:844:58)