summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-07-22 10:05:49 +0000
committerMartin Trigaux <mat@odoo.com>2019-07-22 10:05:49 +0000
commitaadc4a9f0be4a17ab3f25c48ac26feabf9aaab9a (patch)
tree3b9dd52a473cc11d3a211c19ae62e8416ef6ef70 /addons/web/static/src/js/views/basic
parent1ebec12dc0f5b2a431a52b89909a949529e0b6ad (diff)
parentfe4caecb59dd9a4456bbf40563a842ca7e318307 (diff)
[MERGE] Forward port of saas-12.3 to saas-12.4 up to fe4caecb59d
closes odoo/odoo#35059 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_controller.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js
index 610e7e6dc6b..e76aec046e8 100644
--- a/addons/web/static/src/js/views/basic/basic_controller.js
+++ b/addons/web/static/src/js/views/basic/basic_controller.js
@@ -374,14 +374,16 @@ var BasicController = AbstractController.extend(FieldManagerMixin, {
* the new record to be in edit mode too, but the view manager calls
* this function as the URL changes...) @todo get rid of this when
* the webclient/action_manager's hashchange mechanism is improved.
+ * @param {boolean} [options.noAbandon=false]
* @returns {Promise}
*/
_discardChanges: function (recordID, options) {
var self = this;
recordID = recordID || this.handle;
+ options = options || {};
return this.canBeDiscarded(recordID)
.then(function (needDiscard) {
- if (options && options.readonlyIfRealDiscard && !needDiscard) {
+ if (options.noAbandon || (options.readonlyIfRealDiscard && !needDiscard)) {
return;
}
self.model.discardChanges(recordID);