From 22e7b6befb77005d1b1945977191ca11739f38fa Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Fri, 17 Mar 2017 11:11:42 +0100 Subject: [PATCH] [FIX] web_kanban: only give fields in view to record This commit partially reverts 5b4f7c1 where `fields_view.fields` had been replaced by `fields`, which could have been set to all fields in the model. This modification can sometimes lead to a problem, during the fields value transformation. The ID, which wasn't given previously is now parsed. When creating a new record, the field ID is not an integer but a string (representing the virtual ID). If the field is in the arch, it will be postprocessed (see https://github.com/odoo/odoo/blob/saas-11/addons/web/static/src/js/framework/data_manager.js#L201) and its type will become `id`. As this postprocessing is not done if the field in the view, the parsing was on the original type (integer) and not the special id type. --- addons/web_kanban/static/src/js/kanban_view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_kanban/static/src/js/kanban_view.js b/addons/web_kanban/static/src/js/kanban_view.js index a0ed0761dcf..30a3517a7bc 100644 --- a/addons/web_kanban/static/src/js/kanban_view.js +++ b/addons/web_kanban/static/src/js/kanban_view.js @@ -376,7 +376,7 @@ var KanbanView = View.extend({ this.record_options = { editable: this.is_action_enabled('edit'), deletable: this.is_action_enabled('delete'), - fields: this.fields, + fields: this.fields_view.fields, qweb: this.qweb, model: this.model, read_only_mode: this.options.read_only_mode, @@ -427,7 +427,7 @@ var KanbanView = View.extend({ grouped_by_m2o: this.grouped_by_m2o, relation: this.relation, qweb: this.qweb, - fields: this.fields, + fields: this.fields_view.fields, quick_create: this._is_quick_create_enabled(), }; },