Skip to content

Commit

Permalink
[FIX] Issue OCA#906
Browse files Browse the repository at this point in the history
  • Loading branch information
Tardo authored and MiquelRForgeFlow committed Mar 20, 2019
1 parent 7759b61 commit 3d8eb47
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ odoo.define('web_tree_dynamic_colored_field', function (require) {
if (colorAttr.length > 0) {
var colorField = colorAttr[0].split(':')[1].trim();
// validate the presence of that field in tree view
var fieldNames = _(this.columns).map(
(value) => { return value.attrs.name; }
);
if (fieldNames.indexOf(colorField) === -1) {
if (this.state.data.length && colorField in this.state.data[0].data) {
this.colorField = colorField;
} else {
console.warn(
"No field named '" + colorField + "' present in view."
);
} else {
this.colorField = colorField;
}
}
}
Expand Down

0 comments on commit 3d8eb47

Please sign in to comment.