diff --git a/web_tree_dynamic_colored_field/README.rst b/web_tree_dynamic_colored_field/README.rst
index 13c1e46e9200..054b0c3d75cb 100644
--- a/web_tree_dynamic_colored_field/README.rst
+++ b/web_tree_dynamic_colored_field/README.rst
@@ -124,6 +124,24 @@ Example:
the options doesn't follow the JSON format, the options string will be
evaluated using py.eval()**
+- You can use another field's label referring to a color too... In the
+ tree view declaration, put
+ ``options="{'fg_color': 'my_other_color_field'}"`` attribute in the
+ ``field`` tag:
+
+ ::
+
+ ...
+
+
+ ...
+
+
+ ...
+
+
+ ...
+
Known issues / Roadmap
======================
diff --git a/web_tree_dynamic_colored_field/readme/USAGE.md b/web_tree_dynamic_colored_field/readme/USAGE.md
index b5950598ff01..a60ede0b4565 100644
--- a/web_tree_dynamic_colored_field/readme/USAGE.md
+++ b/web_tree_dynamic_colored_field/readme/USAGE.md
@@ -68,3 +68,18 @@ Example:
**Note that you can use single or normal quotes. If the declaration of
the options doesn't follow the JSON format, the options string will be
evaluated using py.eval()**
+
+- You can use another field's label referring to a color too... In the tree view declaration, put
+ `options="{'fg_color': 'my_other_color_field'}"`
+ attribute in the `field` tag:
+
+ ...
+
+
+ ...
+
+
+ ...
+
+
+ ...
\ No newline at end of file
diff --git a/web_tree_dynamic_colored_field/static/description/index.html b/web_tree_dynamic_colored_field/static/description/index.html
index 946fa0bb26d9..e53250da00ff 100644
--- a/web_tree_dynamic_colored_field/static/description/index.html
+++ b/web_tree_dynamic_colored_field/static/description/index.html
@@ -465,6 +465,25 @@
Note that you can use single or normal quotes. If the declaration of
the options doesn’t follow the JSON format, the options string will be
evaluated using py.eval()
+
+You can use another field’s label referring to a color too… In the
+tree view declaration, put
+options="{'fg_color': 'my_other_color_field'}" attribute in the
+field tag:
+
+...
+<field name="arch" type="xml">
+ <tree string="View name">
+ ...
+ <field name="my_other_color_field" column_invisible="True"/>
+ <field name="name" options="{'fg_color': 'my_other_color_field'}"/>
+ ...
+ </tree>
+</field>
+...
+
+
+
diff --git a/web_tree_dynamic_colored_field/static/src/js/list_renderer.esm.js b/web_tree_dynamic_colored_field/static/src/js/list_renderer.esm.js
index 76612d4cb711..9b799afdb876 100644
--- a/web_tree_dynamic_colored_field/static/src/js/list_renderer.esm.js
+++ b/web_tree_dynamic_colored_field/static/src/js/list_renderer.esm.js
@@ -54,6 +54,11 @@ patch(ListRenderer.prototype, {
}
}
}
+ // 'definition' can be a field's label referring to a color
+ if (definition in record.data && record.data[definition]) {
+ result = record.data[definition];
+ }
+
return result || undefined;
}
},