diff --git a/dashboard_pos/README.rst b/dashboard_pos/README.rst index fde32b476..6f479e09b 100644 --- a/dashboard_pos/README.rst +++ b/dashboard_pos/README.rst @@ -4,7 +4,7 @@ POS Dashboard Installation ============ - - www.odoo.com/documentation/16.0/setup/install.html + - www.odoo.com/documentation/14.0/setup/install.html - Install our custom addon Configuration diff --git a/dashboard_pos/__manifest__.py b/dashboard_pos/__manifest__.py index bcc063dfb..c3d8aedb9 100644 --- a/dashboard_pos/__manifest__.py +++ b/dashboard_pos/__manifest__.py @@ -38,13 +38,11 @@ ], 'assets': { 'web.assets_backend': [ + 'dashboard_pos/static/src/xml/pos_dashboard.xml', 'dashboard_pos/static/src/js/pos_dashboard.js', 'dashboard_pos/static/src/css/pos_dashboard.css', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.js', ], - 'web.assets_qweb': [ - 'dashboard_pos/static/src/xml/pos_dashboard.xml', - ], }, 'images': ['static/description/banner.png'], 'license': "AGPL-3", diff --git a/dashboard_pos/static/src/js/pos_dashboard.js b/dashboard_pos/static/src/js/pos_dashboard.js index 808320b23..6ff95daf4 100644 --- a/dashboard_pos/static/src/js/pos_dashboard.js +++ b/dashboard_pos/static/src/js/pos_dashboard.js @@ -2,11 +2,15 @@ odoo.define('dashboard_pos.Dashboard', function (require) { "use strict"; var AbstractAction = require('web.AbstractAction'); -var ajax = require('web.ajax'); var core = require('web.core'); -var rpc = require('web.rpc'); +const { loadBundle } = require("@web/core/assets"); +var ajax = require('web.ajax'); +//var field_utils = require('web.field_utils'); +//var pyUtils = require('web.py_utils'); var session = require('web.session'); +//var time = require('web.time'); var web_client = require('web.web_client'); +var rpc = require('web.rpc'); var _t = core._t; var QWeb = core.qweb; @@ -36,12 +40,25 @@ var PosDashboard = AbstractAction.extend({ this.today_sale = []; }, + +// willStart: function() { +// var self = this; +// return $.when(ajax.loadLibs(this), this._super()).then(function() { +// return self.fetch_data(); +// }); +// }, + + willStart: function() { var self = this; - return $.when(ajax.loadLibs(this), this._super()).then(function() { + return $.when(loadBundle(this), this._super()).then(function() { return self.fetch_data(); }); }, +// willStart: function() { +// var self = this; +// return Promise.all([loadBundle(this), this._super()]).then(function() { +// return self.fetch_data(); start: function() { var self = this;