diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 3abbc7abffe..982b497f644 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -104,8 +104,7 @@ html_template = """
@@ -323,6 +322,7 @@ class WebClient(openerpweb.Controller):
'js': js,
'css': css,
'modules': simplejson.dumps(self.server_wide_modules(req)),
+ 'init': 'var wc = new s.web.WebClient();wc.appendTo($(document.body));'
}
return r
diff --git a/addons/web/i18n/nl.po b/addons/web/i18n/nl.po
index 057d2f0ddf1..78cd13ffd97 100644
--- a/addons/web/i18n/nl.po
+++ b/addons/web/i18n/nl.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
-"PO-Revision-Date: 2012-03-29 13:30+0000\n"
+"PO-Revision-Date: 2012-04-02 13:15+0000\n"
"Last-Translator: Erwin \n"
"Language-Team: Dutch \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-03-30 04:48+0000\n"
-"X-Generator: Launchpad (build 15032)\n"
+"X-Launchpad-Export-Date: 2012-04-03 05:16+0000\n"
+"X-Generator: Launchpad (build 15052)\n"
#. openerp-web
#: addons/web/static/src/js/chrome.js:172
@@ -879,7 +879,7 @@ msgstr "OpenERP Enterprise Contract."
#. openerp-web
#: addons/web/static/src/xml/base.xml:257
msgid "Your report will be sent to the OpenERP Enterprise team."
-msgstr "Uw rapport wordt verzonden naar het OpenERP Entreprice team."
+msgstr "Uw rapport wordt verzonden naar het OpenERP Enterprise team."
#. openerp-web
#: addons/web/static/src/xml/base.xml:259
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index aec1b8aeffc..277c7ef5652 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -989,7 +989,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
self.$element.toggleClass('clark-gable');
});
}
- this.session.bind_session().then(function() {
+ this.session.session_bind().then(function() {
if (!self.session.session_is_valid()) {
self.show_login();
}
@@ -1166,7 +1166,7 @@ openerp.web.embed = function (origin, dbname, login, key, action, options) {
var sc = document.getElementsByTagName('script');
currentScript = sc[sc.length-1];
}
- openerp.connection.bind_session(origin).then(function () {
+ openerp.connection.session_bind(origin).then(function () {
openerp.connection.session_authenticate(dbname, login, key, true).then(function () {
var client = new openerp.web.EmbeddedClient(action, options);
client.insertAfter(currentScript);
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js
index bc2bf951294..094c81ffa54 100644
--- a/addons/web/static/src/js/core.js
+++ b/addons/web/static/src/js/core.js
@@ -385,7 +385,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
this.name = openerp._session_id;
this.qweb_mutex = new $.Mutex();
},
- bind_session: function(origin) {
+ session_bind: function(origin) {
var window_origin = location.protocol+"//"+location.host, self=this;
this.origin = origin ? _.str.rtrim(origin,'/') : window_origin;
this.prefix = this.origin;
@@ -559,52 +559,67 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
* FIXME: Huge testing hack, especially the evaluation context, rewrite + test for real before switching
*/
test_eval: function (source, expected) {
+ var match_template = '' +
+ '- Source: %(source)s
' +
+ '- Local: %(local)s
' +
+ '- Remote: %(remote)s
' +
+ '
',
+ fail_template = '' +
+ '- Error: %(error)s
' +
+ '- Source: %(source)s
' +
+ '
';
try {
var ctx = this.test_eval_contexts(source.contexts);
if (!_.isEqual(ctx, expected.context)) {
- console.group('Local context does not match remote, nothing is broken but please report to R&D (xmo)');
- console.warn('source', source.contexts);
- console.warn('local', ctx);
- console.warn('remote', expected.context);
- console.groupEnd();
+ openerp.webclient.notification.warn('Context mismatch, report to xmo',
+ _.str.sprintf(match_template, {
+ source: JSON.stringify(source.contexts),
+ local: JSON.stringify(ctx),
+ remote: JSON.stringify(expected.context)
+ }), true);
}
} catch (e) {
- console.group('Failed to evaluate contexts, nothing is broken but please report to R&D (xmo)');
- console.error(e);
- console.log('source', source.contexts);
- console.groupEnd();
+ openerp.webclient.notification.warn('Context fail, report to xmo',
+ _.str.sprintf(fail_template, {
+ error: e.message,
+ source: JSON.stringify(source.contexts)
+ }), true);
}
try {
var dom = this.test_eval_domains(source.domains, this.test_eval_get_context());
if (!_.isEqual(dom, expected.domain)) {
- console.group('Local domain does not match remote, nothing is broken but please report to R&D (xmo)');
- console.warn('source', source.domains);
- console.warn('local', dom);
- console.warn('remote', expected.domain);
- console.groupEnd();
+ openerp.webclient.notification.warn('Domains mismatch, report to xmo',
+ _.str.sprintf(match_template, {
+ source: JSON.stringify(source.domains),
+ local: JSON.stringify(dom),
+ remote: JSON.stringify(expected.domain)
+ }), true);
}
} catch (e) {
- console.group('Failed to evaluate domains, nothing is broken but please report to R&D (xmo)');
- console.error(e);
- console.log('source', source.domains);
- console.groupEnd();
+ openerp.webclient.notification.warn('Domain fail, report to xmo',
+ _.str.sprintf(fail_template, {
+ error: e.message,
+ source: JSON.stringify(source.domains)
+ }), true);
}
try {
var groups = this.test_eval_groupby(source.group_by_seq);
if (!_.isEqual(groups, expected.group_by)) {
- console.group('Local groupby does not match remote, nothing is broken but please report to R&D (xmo)');
- console.warn('source', source.group_by_seq);
- console.warn('local', groups);
- console.warn('remote', expected.group_by);
- console.groupEnd();
+ openerp.webclient.notification.warn('GroupBy mismatch, report to xmo',
+ _.str.sprintf(match_template, {
+ source: JSON.stringify(source.group_by_seq),
+ local: JSON.stringify(groups),
+ remote: JSON.stringify(expected.group_by)
+ }), true);
}
} catch (e) {
- console.group('Failed to evaluate groupby, nothing is broken but please report to R&D (xmo)');
- console.error(e);
- console.log('source', source.group_by_seq);
- console.groupEnd();
+ openerp.webclient.notification.warn('GroupBy fail, report to xmo',
+ _.str.sprintf(fail_template, {
+ error: e.message,
+ source: JSON.stringify(source.group_by_seq)
+ }), true);
}
},
test_eval_contexts: function (contexts) {