odoo js error无法读取属性' include'未定义的包括基本日历的功能

时间:2017-10-16 03:19:00

标签: javascript openerp odoo-10

我想用新的自定义函数修改base_calendar.js,如下所示

CalendarNotification = require('base_calendar.base_calendar');

console.log("Masuk sini bawah");

CalendarNotification.include({
    'click .link2showed': function() {
        console.log("ndak yo mlebu kene to");
        var action = {
            type: 'ir.actions.act_window',
            res_model: 'crm.lead',
            view_mode: 'form',
            view_type: 'form',
            views: [[false, 'form']],
            res_id: 16644
        };
        this.do_action(action);
    },
});

这是一个base_calendar.js odoo addons

var Notification = require('web.notification').Notification;

var CalendarNotification = Notification.extend({
    template: "CalendarNotification",

    init: function(parent, title, text, eid) {
        this._super(parent, title, text, true);
        this.eid = eid;

        this.events = _.extend(this.events || {}, {
            'click .link2event': function() {
                var self = this;

                this.rpc("/web/action/load", {
                    action_id: "calendar.action_calendar_event_notify",
                }).then(function(r) {
                    r.res_id = self.eid;
                    return self.do_action(r);
                });
            },

            'click .link2recall': function() {
                this.destroy(true);
            },
            'click .link2showed2': function() {
                this.destroy(true);
                this.rpc("/calendar/notify_ack");

            },
        });
    },
});

如何解决这个问题以及导致问题的原因?我曾多次使用自定义函数JS并且运行良好。

提前感谢任何指示。

0 个答案:

没有答案