%(javascript)s
<script type="text/javascript">
$(function() {
- var c = new openerp.init();
+ var c = new openerp.init(%(modules)s);
var wc = new c.web.WebClient("oe");
wc.start();
});
if req.debug:
csslist = [i + '?debug=' + str(time.time()) for i in manifest_glob(None, 'css')]
css = "\n ".join(['<link rel="stylesheet" href="%s">'%i for i in csslist])
+
r = home_template % {
'javascript': js,
- 'css': css
+ 'css': css,
+ 'modules': simplejson.dumps(manifest_preload()),
}
return r
/**
* OpenERP instance constructor
*
- * @param {Boolean} skip_init if true, skips the built-in initialization
+ * @param {Array} modules list of modules to initialize
*/
- init: function(skip_init) {
+ init: function(modules) {
var new_instance = {
// links to the global openerp
_openerp: openerp,
web_mobile: {}
};
openerp.sessions[new_instance._session_id] = new_instance;
- if (!skip_init){
- openerp.web(new_instance);
+ modules = modules || ["web"];
+ for(var i=0; i < modules.length; i++) {
+ openerp[modules[i]](new_instance);
}
return new_instance;
}
"js": ["static/*/*.js", "static/*/js/*.js"],
"css": [],
'active': False,
+ 'web_preload': True,
}
// here you may tweak globals object, if any, and play with on_* or do_* callbacks on them
+openerp.web.Login = openerp.web.Login.extend({
+ start: function() {
+ console.log('Hello there');
+ this._super.apply(this,arguments);
+ }
+});
+
};
// vim:et fdc=0 fdl=0: