From 5e7e8e90b356c4e954873ddeb558a7c267002073 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 16 Jun 2015 12:32:57 +0200 Subject: [PATCH] [FIX] web: add 'forget' commands in AbstractManyField --- .../web/static/src/js/views/form_relational_widgets.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js index a572e1b0ec6..df8e0150aa1 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -599,6 +599,14 @@ var AbstractManyField = common.AbstractField.extend({ return this.send_commands([COMMANDS.delete(id)]); }, + /* + *@value: id {int or string} id or virtual id of the record to removes relation (unlink or delete function of field type) + *@return deferred + */ + data_forget: function (id) { + return this.send_commands([COMMANDS.forget(id)]); + }, + /* *@value: ids {array} list of ids or virtual ids of the record who replace the previous list * options {object} options sent to the dataset @@ -646,6 +654,8 @@ var AbstractManyField = common.AbstractField.extend({ }); case COMMANDS.UPDATE: return dataset.write(command[1], command[2], options); + case COMMANDS.FORGET: + return dataset.remove_ids([command[1]]); case COMMANDS.DELETE: return dataset.unlink(command[1]); case COMMANDS.LINK_TO: