Skip to content

Commit

Permalink
Merge PR OCA#2386 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by StefanRijnhart
  • Loading branch information
OCA-git-bot committed Feb 20, 2024
2 parents 44e18eb + db52434 commit 8ddd680
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
14 changes: 13 additions & 1 deletion web_tree_dynamic_colored_field/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,19 @@ Example:
overrides the rest of `colors` attributes, and that you need the tree
to load your field in the first place by adding it as invisible field.
**Note that you should always use single quotes for fields' ``options`` and wrap nested values in double quotes since ``options`` is a JSON object.**
* Can use strings too... In the tree view declaration, put ``options="{'fg_color': 'green:customer_state == \'success\''}"`` attribute in the ``field`` tag::

...
<field name="arch" type="xml">
<tree string="View name">
...
<field name="name" options="{'fg_color': 'green:customer_state == \'success\''}"/>
...
</tree>
</field>
...

**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()**

Known issues / Roadmap
======================
Expand Down
14 changes: 13 additions & 1 deletion web_tree_dynamic_colored_field/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,16 @@ Example:
overrides the rest of `colors` attributes, and that you need the tree
to load your field in the first place by adding it as invisible field.
**Note that you should always use single quotes for fields' ``options`` and wrap nested values in double quotes since ``options`` is a JSON object.**
* Can use strings too... In the tree view declaration, put ``options="{'fg_color': 'green:customer_state == \'success\''}"`` attribute in the ``field`` tag::

...
<field name="arch" type="xml">
<tree string="View name">
...
<field name="name" options="{'fg_color': 'green:customer_state == \'success\''}"/>
...
</tree>
</field>
...

**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()**
17 changes: 16 additions & 1 deletion web_tree_dynamic_colored_field/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,22 @@ <h1>Usage</h1>
</span>overrides<span class="w"> </span>the<span class="w"> </span>rest<span class="w"> </span>of<span class="w"> </span>`colors`<span class="w"> </span>attributes,<span class="w"> </span>and<span class="w"> </span>that<span class="w"> </span>you<span class="w"> </span>need<span class="w"> </span>the<span class="w"> </span>tree<span class="w">
</span>to<span class="w"> </span>load<span class="w"> </span>your<span class="w"> </span>field<span class="w"> </span>in<span class="w"> </span>the<span class="w"> </span>first<span class="w"> </span>place<span class="w"> </span>by<span class="w"> </span>adding<span class="w"> </span>it<span class="w"> </span>as<span class="w"> </span>invisible<span class="w"> </span>field.
</pre>
<p><strong>Note that you should always use single quotes for fields’ ``options`` and wrap nested values in double quotes since ``options`` is a JSON object.</strong></p>
<ul>
<li><p class="first">Can use strings too… In the tree view declaration, put <tt class="docutils literal"><span class="pre">options=&quot;{'fg_color':</span> 'green:customer_state == <span class="pre">\'success\''}&quot;</span></tt> attribute in the <tt class="docutils literal">field</tt> tag:</p>
<pre class="literal-block">
...
&lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt;
&lt;tree string=&quot;View name&quot;&gt;
...
&lt;field name=&quot;name&quot; options=&quot;{'fg_color': 'green:customer_state == \'success\''}&quot;/&gt;
...
&lt;/tree&gt;
&lt;/field&gt;
...
</pre>
</li>
</ul>
<p><strong>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()</strong></p>
</div>
<div class="section" id="known-issues-roadmap">
<h1>Known issues / Roadmap</h1>
Expand Down

0 comments on commit 8ddd680

Please sign in to comment.