summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2013-11-22 18:24:22 +0100
committerChristophe Simonis <chs@openerp.com>2013-11-22 18:24:22 +0100
commit162dd9ad178f7ea3d2ecf06a9cf7acbc3d6198c5 (patch)
treeff44b8151722d777eb6646f6c93670f5899666a8 /addons/web/static/src/js
parentc782692d56a6b81f9b128a87069c4293ab2c1753 (diff)
parent1be71fdae6d01169b50dff6f3eb7657a98436dce (diff)
[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
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/view_form.js22
-rw-r--r--addons/web/static/src/js/view_list.js1
2 files changed, 9 insertions, 14 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index d6733a1dae1..46393093d6f 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -722,12 +722,13 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
var self = this;
return this.save().done(function(result) {
self.trigger("save", result);
- self.to_view_mode();
- }).then(function(result) {
- var parent = self.ViewManager.ActionManager.getParent();
- if(parent){
- parent.menu.do_reload_needaction();
- }
+ self.reload().then(function() {
+ self.to_view_mode();
+ var parent = self.ViewManager.ActionManager.getParent();
+ if(parent){
+ parent.menu.do_reload_needaction();
+ }
+ });
});
},
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.
*/
record_saved: function(r) {
- var self = this;
+ this.trigger('record_saved', r);
if (!r) {
// should not happen in the server, but may happen for internal purpose
- this.trigger('record_saved', r);
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:
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index ff99eb5df9d..17c62917a18 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -508,7 +508,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
var reloaded = $.Deferred();
this.$el.find('.oe_list_content').append(
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.records.length) {
self.dataset.index = 0;