diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-04-14 16:17:11 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-14 22:36:55 +0200 |
| commit | a6ce395f302356ffa304ad500f24d71cff9174a9 (patch) | |
| tree | 9c8c7a56036cbb8490bd1b8e2b7c805c28bb788e /addons/web/static/src/js/fields/relational_fields.js | |
| parent | 0494d612749cd0b7e937d3828775ca54961a29b9 (diff) | |
[FIX] web: field Many2ManyCheckboxes: add and remove values
There were several issues with this widget, and the way the model
handles its requests (mainly the removal of values).
It crashed for instance on the product form view when the user
updated the routes field (field route_ids in tab inventory).
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 42c959e2528..4c05946cf23 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -705,7 +705,7 @@ var FieldX2Many = AbstractField.extend({ event.stopPropagation(); this._setValue({ operation: 'REMOVE', - id: event.data.id + ids: [event.data.id], }); }, /** @@ -999,7 +999,7 @@ var FieldMany2ManyTags = AbstractField.extend({ var record = _.findWhere(this.value.data, {res_id: id}); this._setValue({ operation: 'REMOVE', - id: record.id + ids: [record.id], }); }, /** @@ -1207,7 +1207,7 @@ var FieldMany2ManyCheckBoxes = AbstractField.extend({ _render: function () { var self = this; this._super.apply(this, arguments); - _.each(this.value, function (id) { + _.each(this.value.res_ids, function (id) { self.$('input[data-record-id="' + id + '"]').prop('checked', true); }); }, |
