Add the willStart() function to Widgets. This function is executed
between init() and start() and its purpose is to perform various
asynchronous calls required for start() to be executed.
It is automatically called after rendering a Widget, and start() is
called once the Deferred returned by willStart() is resolved.
For historic reasons, the session had a name (hardcoded to "instance0"),
used in at least one place: the get and set cookie methods.
The idea was most likely to allow multiple instances of the web client
to coexist peacefully. This does not work at all at least for the last
versions, and the new module system is a better way to do it anyway.
However, before removing completely the prefix in cookies, we should
actually check if no external code depends on it.
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.