This way, any module requiring web.core has access to this hook.
var core = require('web.core');
core.bus.on('web_client_ready', this, function() {console.log('ready')});
If the method `import_file` is called with the new API, the context is a
frozendict and the update will raise `NotImplementedError: 'update' not
supported on frozendict`
closes#5798
database manager is the only html file we have, and because of that,
regularly escapes the greps. It was still trying to load old files
before the javascript modules. It has now been updated to the new
file structure.
Also, I had to guard the nv customization from happening in misc.js
because the nvd3 library is not loaded in the database manager, but
the misc.js file is required. Not really happy about the misc.js file,
but this is for another commit.
This branch introduces a new module system for our javascript
code, inspired by requirejs. It is a really large change,
since all the javascript code had to be updated to use the
new system.
Some important remarks:
* the openerp global variable has been deprecated. Do not use
it in the future
* a new global variable has been introduced: odoo. It contains
the 'define' function used to create new modules. Use it
to create modules, not as a global bag of things.
* the web client code has been refactored. Most files have
been split into smaller files. The code should be easier to
understand now
More documentation can be found at:
www.odoo.com/documentation/master/reference/javascript.html#web-client
The module system needs to know the dependencies of a given module
before executing the function. This is why the dependencies were
defined once in an array, and then were described one more times in the
call to require.
But a trick can simplify this: the boot function can parse the string
representation of the module and extract the calls to require from it.
It is more work for the processor, but it leads to simpler module
definitions.
The testing framework was done with an old version of qunit. We had to
program our layer on top of it to provide support for promises in tests.
The last version of qunit now supports promises, and the testing
framework needs to be reworked anyway with the new modules.