summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/form_relational_widgets.js
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2015-09-18 11:42:03 +0200
committerMartin Geubelle <mge@odoo.com>2015-10-01 10:51:26 +0200
commitb2636c026faaec6c2633255136a9544a23eb6efe (patch)
treecdd732f374e05de1a7c015fc68f1d1e772cd88ab /addons/web/static/src/js/views/form_relational_widgets.js
parenta0ea75e5f1dea41452e394996b60821139e29daf (diff)
[FIX] web: dataset aware of m2m tags color change
Use case: create a new tag, change its color and create another new tag. The m2m field was rendered again but the dataset was not aware of the color change on the first new tag. We need to invalidate the cache after changing the color in a tag in edit mode.
Diffstat (limited to 'addons/web/static/src/js/views/form_relational_widgets.js')
-rw-r--r--addons/web/static/src/js/views/form_relational_widgets.js4
1 files changed, 3 insertions, 1 deletions
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 428a2fe4758..ba6573ed306 100644
--- a/addons/web/static/src/js/views/form_relational_widgets.js
+++ b/addons/web/static/src/js/views/form_relational_widgets.js
@@ -1490,7 +1490,9 @@ var FieldMany2ManyTags = AbstractManyField.extend(common.CompletionFieldMixin, c
var id = $(ev.currentTarget).data('id');
var self = this;
- this.dataset._model.call('write', [id, {'color': color}]).done(function(){
+ this.dataset.call('write', [id, {'color': color}]).done(function(){
+ self.dataset.cache[id].from_read = {};
+ self.dataset.evict_record(id);
var tag = self.$el.find("span.badge[data-id='" + id + "']");
var old_color = tag.data('color');
tag.removeClass('o_tag_color_' + old_color);