[MERGE] forward port of branch 7.0 up to revid 4075 chs@openerp.com-20131122170316-lbuxddprrgz1are3
bzr revid: chs@openerp.com-20131122131553-i22dj95bvofb7aeu bzr revid: chs@openerp.com-20131122172422-tsd8wzqkbqknrw1w
This commit is contained in:
commit
162dd9ad17
|
@ -722,12 +722,13 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
||||||
var self = this;
|
var self = this;
|
||||||
return this.save().done(function(result) {
|
return this.save().done(function(result) {
|
||||||
self.trigger("save", result);
|
self.trigger("save", result);
|
||||||
self.to_view_mode();
|
self.reload().then(function() {
|
||||||
}).then(function(result) {
|
self.to_view_mode();
|
||||||
var parent = self.ViewManager.ActionManager.getParent();
|
var parent = self.ViewManager.ActionManager.getParent();
|
||||||
if(parent){
|
if(parent){
|
||||||
parent.menu.do_reload_needaction();
|
parent.menu.do_reload_needaction();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
on_button_cancel: function(event) {
|
on_button_cancel: function(event) {
|
||||||
|
@ -891,17 +892,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
||||||
* @param {Object} r result of the write function.
|
* @param {Object} r result of the write function.
|
||||||
*/
|
*/
|
||||||
record_saved: function(r) {
|
record_saved: function(r) {
|
||||||
var self = this;
|
this.trigger('record_saved', r);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
// should not happen in the server, but may happen for internal purpose
|
// should not happen in the server, but may happen for internal purpose
|
||||||
this.trigger('record_saved', r);
|
|
||||||
return $.Deferred().reject();
|
return $.Deferred().reject();
|
||||||
} else {
|
|
||||||
return $.when(this.reload()).then(function () {
|
|
||||||
self.trigger('record_saved', r);
|
|
||||||
return r;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
return r;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Updates the form' dataset to contain the new record:
|
* Updates the form' dataset to contain the new record:
|
||||||
|
|
|
@ -508,7 +508,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
||||||
var reloaded = $.Deferred();
|
var reloaded = $.Deferred();
|
||||||
this.$el.find('.oe_list_content').append(
|
this.$el.find('.oe_list_content').append(
|
||||||
this.groups.render(function () {
|
this.groups.render(function () {
|
||||||
// Keep '=='. This is not a mistake, this is a wanted behaviour to match null & undefined
|
|
||||||
if (self.dataset.index == null) {
|
if (self.dataset.index == null) {
|
||||||
if (self.records.length) {
|
if (self.records.length) {
|
||||||
self.dataset.index = 0;
|
self.dataset.index = 0;
|
||||||
|
|
Loading…
Reference in New Issue