From 9100e675dfe7ae60ea3c8f1a5ef1e9a78a4ab4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Sun, 2 Apr 2017 21:04:31 +0200 Subject: [FIX] web: add support for discarding lines in o2m This is not a complete work, but it introduces the basic infrastructure to properly edit various more sophisticated editing behaviours. The main focus of this commit is to handle discarding invalid lines in one2many, potentially asking the user for confirmation. So, the relevant methods have to be modified to return some deferred, because the operation is now asynchronous. --- addons/web/static/src/js/views/view_dialogs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/view_dialogs.js') diff --git a/addons/web/static/src/js/views/view_dialogs.js b/addons/web/static/src/js/views/view_dialogs.js index fe7ddddaf10..6f0fe8328c3 100644 --- a/addons/web/static/src/js/views/view_dialogs.js +++ b/addons/web/static/src/js/views/view_dialogs.js @@ -207,7 +207,7 @@ var FormViewDialog = ViewDialog.extend({ var self = this; var def; if (this.options.on_save) { - if (this.form_view.checkInvalidFields()) { + if (this.form_view.canBeSaved()) { return $.Deferred().reject(); } def = this.options.on_save(this.form_view.model.get(this.form_view.handle)); -- cgit v1.2.3