[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.
This commit is contained in:
Martin Geubelle
2017-03-17 11:13:49 +01:00
parent 5f9d382ed4
commit 22e7b6befb
@@ -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(),
};
},