Skip to content

Commit

Permalink
Add description
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Nechyporenko committed Nov 21, 2023
1 parent 95f1ebb commit 10718be
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions crnd_web_tree_colored_field/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ <h1 style="color:#875A7B;">CRnD Web Tree Colored Field</h1>

<section style="margin: 0 auto; max-width: 896px;">
<div>
<p>CRnD Web Tree Colored Field widget provide to display tree cell with color from another field.</p>
<p>CRnD Web Tree Colored Field widget provide to display tree cell with color from another field or color, that depends on value of other field.</p>
</div>
<p><br></p>
<p>An example of internal usage:</p>
<p>An example of internal usage defining color from another field:</p>
<p>In Python code:</p>
<pre>
line_bg_color = fields.Char('rgba(R,G,B[,A])')
Expand All @@ -34,6 +34,35 @@ <h1 style="color:#875A7B;">CRnD Web Tree Colored Field</h1>
&lt;/field&gt;
&lt;/record&gt;
</pre>
<p><br></p>
<p>An example of internal usage defining color, depends on value of another field:</p>
<p>In Python code:</p>
<pre>
state = fields.Selection([
('ok', 'Ok'),
('warning', 'Warning'),
('fail', 'Fail')
])
</pre>
<p>In XML code:</p>
<pre> &lt;record id="some_id" model="ir.ui.view"&gt;
&lt;field name="model"&gt;model.name&lt;/field&gt;
&lt;field name="arch" type="xml"&gt;
&lt;tree&gt;
&lt;field name="colored_field"
options="{&quot;field_label_color_expression&quot;: &quot;
red:state == 'fail';
#2F4F4F:state == 'warning';
green:state == 'ok'&quot;,
&quot;field_bg_color_expression&quot;: &quot;
white:state == fail;
yellow:state == 'warning';
#D3D3D3:state == 'ok'&quot;}"/>/&gt;
&lt;field name="state" invisible="1"/&gt;
&lt;/tree&gt;
&lt;/field&gt;
&lt;/record&gt;
</pre>
</div>
</section>

Expand Down

0 comments on commit 10718be

Please sign in to comment.