pad_dashboard.js 1.14 KB
odoo.define('idg_dashboard.pad_dashboard', function (require) {
    "use strict";

    var AbstractAction = require('web.AbstractAction');
    var core = require('web.core');
    var QWeb = core.qweb;
    var PadDashboard = AbstractAction.extend({
        template: 'Dashboard',

        init: function(parent, context) {
            this._super(parent, context);
            this.dashboard_templates = [
                'DashboardTop',
            ];
            this.pad_total_nasional = [];
        },

        start: function() {
            var self = this;
            this.set("title", "Dashboard");
            return this._super().then(function() {
                self.render_dashboards();
            });
        },

        render_dashboards: function() {
            var self = this;
            _.each(this.dashboard_templates, function(template) {
                self.$('.o_pad_dashboard').append(QWeb.render(template, {widget: self}));
            });
        },

        fetch_data: function() {
            // to do : fetching the data
        },

    });

    core.action_registry.add('pad_dashboard_tag', PadDashboard);
    return PadDashboard;
});