mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] Issue #906
This commit is contained in:
@@ -17,15 +17,12 @@ odoo.define('web_tree_dynamic_colored_field', function (require) {
|
|||||||
if (colorAttr.length > 0) {
|
if (colorAttr.length > 0) {
|
||||||
var colorField = colorAttr[0].split(':')[1].trim();
|
var colorField = colorAttr[0].split(':')[1].trim();
|
||||||
// validate the presence of that field in tree view
|
// validate the presence of that field in tree view
|
||||||
var fieldNames = _(this.columns).map(
|
if (this.state.data.length && colorField in this.state.data[0].data) {
|
||||||
(value) => { return value.attrs.name; }
|
this.colorField = colorField;
|
||||||
);
|
} else {
|
||||||
if (fieldNames.indexOf(colorField) === -1) {
|
|
||||||
console.warn(
|
console.warn(
|
||||||
"No field named '" + colorField + "' present in view."
|
"No field named '" + colorField + "' present in view."
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
this.colorField = colorField;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user