Forward-port of latest saas-2 bugfixes, up to rev.3902 revid:mat@openerp.com-20140219111353-cxo860z7ctz7om30
bzr revid: odo@openerp.com-20140219163348-5fpbm3rgpkq7kjw5
This commit is contained in:
commit
59aa0e88d9
|
@ -1336,10 +1336,15 @@ instance.web.WebClient = instance.web.Client.extend({
|
||||||
var state = $.bbq.getState(true);
|
var state = $.bbq.getState(true);
|
||||||
if (_.isEmpty(state) || state.action == "login") {
|
if (_.isEmpty(state) || state.action == "login") {
|
||||||
self.menu.has_been_loaded.done(function() {
|
self.menu.has_been_loaded.done(function() {
|
||||||
var first_menu_id = self.menu.$el.find("a:first").data("menu");
|
new instance.web.Model("res.users").call("read", [self.session.uid, ["action_id"]]).done(function(data) {
|
||||||
if(first_menu_id) {
|
var first_menu_id = self.menu.$el.find("a:first").data("menu");
|
||||||
self.menu.menu_click(first_menu_id);
|
if(first_menu_id)
|
||||||
}
|
self.menu.menu_click(first_menu_id);
|
||||||
|
|
||||||
|
if(data.action_id) {
|
||||||
|
self.action_manager.do_action(data.action_id[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(window).trigger('hashchange');
|
$(window).trigger('hashchange');
|
||||||
|
|
|
@ -452,6 +452,9 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin,
|
||||||
* @returns {$.Deferred}
|
* @returns {$.Deferred}
|
||||||
*/
|
*/
|
||||||
read_ids: function (ids, fields, options) {
|
read_ids: function (ids, fields, options) {
|
||||||
|
if (_.isEmpty(ids))
|
||||||
|
return $.Deferred().resolve([]);
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
// TODO: reorder results to match ids list
|
// TODO: reorder results to match ids list
|
||||||
return this._model.call('read',
|
return this._model.call('read',
|
||||||
|
|
|
@ -1654,9 +1654,12 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
|
||||||
function synchronized(fn) {
|
function synchronized(fn) {
|
||||||
var fn_mutex = new $.Mutex();
|
var fn_mutex = new $.Mutex();
|
||||||
return function () {
|
return function () {
|
||||||
|
var obj = this;
|
||||||
var args = _.toArray(arguments);
|
var args = _.toArray(arguments);
|
||||||
args.unshift(this);
|
return fn_mutex.exec(function () {
|
||||||
return fn_mutex.exec(fn.bind.apply(fn, args));
|
if (obj.isDestroyed()) { return $.when(); }
|
||||||
|
return fn.apply(obj, args)
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
var DataGroup = instance.web.Class.extend({
|
var DataGroup = instance.web.Class.extend({
|
||||||
|
|
|
@ -1353,7 +1353,7 @@ instance.web.View = instance.web.Widget.extend({
|
||||||
"context": this.dataset.get_context(),
|
"context": this.dataset.get_context(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return view_loaded_def.then(function(r) {
|
return this.alive(view_loaded_def).then(function(r) {
|
||||||
self.fields_view = r;
|
self.fields_view = r;
|
||||||
// add css classes that reflect the (absence of) access rights
|
// add css classes that reflect the (absence of) access rights
|
||||||
self.$el.addClass('oe_view')
|
self.$el.addClass('oe_view')
|
||||||
|
|
Loading…
Reference in New Issue