diff options
| author | Pierre Verkest <pverkest@anybox.fr> | 2014-11-06 16:18:33 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2014-11-26 15:42:34 +0100 |
| commit | f0e331e005d830d8b5aaa4cb5e2824d98bd75b2a (patch) | |
| tree | 264e9abeb020355c7a733f95d1c4c86b9e420c93 /addons/web/static | |
| parent | e2dd18f1e7304040974a81cfacce96848eb89719 (diff) | |
[FIX] correctly update many2many in listview (web client)
Fixes the issue #1216 (follow the link for more information). The issue
was caused by a hack in list view: the magical suffix __display is used
in render_cell to determine if a many2many field should be updated. This
commit simply makes sure that old many2many fields + __display keys are
cleared.
A better way would be to redesign/refactor the list view to avoid that
hack in the first place. But this would be a much more complex task.
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/view_list.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 52124d5f896..f9c857c957c 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -541,8 +541,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi self.records.remove(record); return; } - _(_.keys(values)).each(function(key){ - record.set(key, values[key], {silent: true}); + _.each(values, function (value, key) { + record.set(key + '__display', false, {silent: true}); + record.set(key, value, {silent: true}); }); record.trigger('change', record); }); |
