summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/view_dialogs.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-03-30 13:45:27 +0200
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit1fadf4a793920870e7dd8fb4c95f4b314fdd28fe (patch)
treee152181d7da7b95d3689b16ac52c04ce843ef126 /addons/web/static/src/js/views/view_dialogs.js
parent97b4da489d48339b9cbadd358e0bea5bb4e56f38 (diff)
[FIX] web: o2m: save updates of one2many records
With this commit, updates of existing o2m records are now correctly saved in DB when clicking on 'Save' in the main form view.
Diffstat (limited to 'addons/web/static/src/js/views/view_dialogs.js')
-rw-r--r--addons/web/static/src/js/views/view_dialogs.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/view_dialogs.js b/addons/web/static/src/js/views/view_dialogs.js
index 828ecf58e90..fe7ddddaf10 100644
--- a/addons/web/static/src/js/views/view_dialogs.js
+++ b/addons/web/static/src/js/views/view_dialogs.js
@@ -109,7 +109,9 @@ var FormViewDialog = ViewDialog.extend({
close: true,
click: function () {
if (!readonly) {
- self.form_view.model.discardChanges(self.form_view.handle);
+ self.form_view.model.discardChanges(self.form_view.handle, {
+ rollback: self.shouldSaveLocally,
+ });
}
},
}];
@@ -180,7 +182,7 @@ var FormViewDialog = ViewDialog.extend({
self.form_view = formView;
var fragment = document.createDocumentFragment();
if (self.recordID && self.shouldSaveLocally) {
- self.model.save(self.recordID, {localSave: true});
+ self.model.save(self.recordID, {savePoint: true});
}
self.form_view.appendTo(fragment)
.then(function () {
@@ -213,7 +215,7 @@ var FormViewDialog = ViewDialog.extend({
def = this.form_view.saveRecord({
stayInEdit: true,
reload: false,
- localSave: this.shouldSaveLocally,
+ savePoint: this.shouldSaveLocally,
});
}
return $.when(def).then(function () {