New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MIG][9.0] template: Upgrade JS API #208
Conversation
Thanks for this update 👍 |
👍 Thanks @lasley |
@moylop260, there's a strange error in Travis. Do you have an idea of it? |
I saw the same error from stable branch build It is a traceback from flake8 I'll use travis2docker to debug and fix it.. |
|
||
core.bus.on('web_client_ready', null, function () { | ||
// Script that will be loaded when document is ready | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach doesn't work for website
. Instead, the proper way to determine that the document is ready seems to be via ready()
in web_editor.base
, which returns a Promise object. This means that for website
, the example here should look more like:
var base = require('web_editor.base');
base.ready().done(function() {
// Script that will be loaded when document is ready
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used in website, but on web client (as stated). Maybe we should include both in 2 files: one for web, and another for website.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason to not include as many examples as possible. @pedrobaeza you're thinking a separate file would be good instead of just putting both here and commenting the difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm thinking about 2 files, naming then web_module_name.js
and website_module_name.js
c95f022
to
8429ead
Compare
Split website sample into separate file and added a web_ namespace to the web ones & rebased onto master to fix conflicts. I did not add a website tour file, because I am not quite sure of the intricacies between the back and front end tours (if any). IMO it would be bad for me to add a sample I am not 100% positive of 😄 |
👍 |
* Upgrade JS to new API * Upgrade onload method to use core bus web_client_ready * Add an exported method * Create website module and namespace web modules
8429ead
to
1b81178
Compare
Squashed. This is good for merge? |
Milestone (Odoo version)
Module(s)
Fixes / new features
REF OCA/web#386 (comment)
cc @antespi @pedrobaeza