简体   繁体   English

将Odo JavaScript从V8和V9迁移到V10

[英]Migrate odoo javascript from v8 & v9 to v10

hay i want to do something with javascript in odoo v10 and when im searching i found what i need but in version 8 and copy it from v8 to 10 it gives me some error and i dont know how to fix it here is the code similar to what i want 干草,我想在odoo v10中使用javascript做某事,当我在即时搜索中发现我需要的东西时,但在版本8中将其从v8复制到10,这给了我一些错误,我不知道如何解决,这里的代码类似于我想要的是

 _.each(result, function(res) { setTimeout(function() { //If notification not already displayed, we add button and action on it if (!($.find(".eid_"+res.event_id)).length) { res.title = QWeb.render('notify_title', {'title': res.title, 'id' : res.event_id}); res.message += QWeb.render("notify_footer"); a = self.do_notify(res.title,res.message,true); a.element.find(".link2showed").on('click',function() { self.get_notif_box(this).find('.ui-notify-close').trigger("click"); self.rpc("/calendar/notify_ack"); }); } 
when i test this code first gives me the "a" is not defined so i put "var" second it gives me error that "element" in a.element is undefined and when i console.log(a) in console print Undefined so i think that self.do_notify(res.title,res.message,true); 当我首先测试此代码时,未定义“ a”,因此我放置了“ var”,这给了我一个错误,即a.element中的“ element”未定义,而当我在console print中的console.log(a)未定义时我认为self.do_notify(res.title,res.message,true); returned with nothing so please can an one help HOW TO DO IT IN Odoo V10 ?????????// 一无所获返回,所以请一个帮助如何在Odoo V10中做到这一点????????? //

_.each(result,  function(res) {setTimeout(function() {
//If notification not already displayed, we add button and action on it
if (!($.find(".eid_"+res.event_id)).length) {
    res.title = QWeb.render('notify_title', {'title': res.title, 'id' : res.event_id});
    res.message += QWeb.render("notify_footer");
    a = self.do_notify(res.title,res.message,true);
    a.element.find(".link2showed").on('click',function() {
        self.get_notif_box(this).find('.ui-notify-close').trigger("click");
        self.rpc("/calendar/notify_ack");
    });
}});  });

Try this.. 尝试这个..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM