[FIX] web_kanban: do no read something you already know
When the groups are loaded in the kanban view, a `read` is done on the relation model to load extra fields. This `read` was done regardless if there really were extra fields to read. This is a priori not a big issue, except if the user has no read access to the relation model and can only perform a `name_get`.
This commit is contained in:
@@ -229,7 +229,7 @@ var KanbanView = View.extend({
|
||||
|
||||
// fetch group data (display information)
|
||||
var group_ids = _.without(_.map(groups, function (elem) { return elem.attributes.value[0];}), undefined);
|
||||
if (options.grouped_by_m2o && group_ids.length) {
|
||||
if (options.grouped_by_m2o && group_ids.length && group_by_fields_to_read.length) {
|
||||
return new data.DataSet(self, options.relation)
|
||||
.read_ids(group_ids, _.union(['display_name'], group_by_fields_to_read))
|
||||
.then(function(results) {
|
||||
|
||||
Reference in New Issue
Block a user