summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/main.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2019-08-23 13:19:24 +0000
committerVincent Schippefilt <vsc@odoo.com>2019-12-09 11:09:10 +0000
commit29726e8fd000cb09075f9b6b2a6a8d2ddaf4ef58 (patch)
tree91718f6edc90cc069ee5ff3b44c4beb823d31104 /addons/web/static/src/js/main.js
parent3b4592acfcd67f2b3e467c5e3f82d7b524b96843 (diff)
[ADD] web: add owl 1.0.0-beta1 to odoo
With this commit, we properly introduce the Owl library into our beloved codebase. More information on the Owl library can be found in the project repository: https://github.com/odoo/owl/ Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Julien Mougenot <jum@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/main.js')
-rw-r--r--addons/web/static/src/js/main.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/addons/web/static/src/js/main.js b/addons/web/static/src/js/main.js
new file mode 100644
index 00000000000..35f00254ba8
--- /dev/null
+++ b/addons/web/static/src/js/main.js
@@ -0,0 +1,27 @@
+odoo.define('web.web_client', function (require) {
+
+ const env = require('web.env');
+ const session = require("web.session");
+ const WebClient = require('web.WebClient');
+
+ owl.config.mode = env.isDebug() ? "dev" : "prod";
+ owl.Component.env = env;
+
+ const webClient = new WebClient();
+
+ /**
+ * Add the owl templates to the environment and start the web client.
+ */
+ async function startWebClient() {
+ await session.is_bound;
+ env.qweb.addTemplates(session.owlTemplates);
+
+ await owl.utils.whenReady();
+ webClient.setElement($(document.body));
+ webClient.start();
+ }
+
+ startWebClient();
+
+ return webClient;
+});