Skip to content

Commit ffd42c5

Browse files
committed
fix(spp_approval): use ace 'javascript' mode for CEL fields
CEL uses JS-family syntax (&&, ||, !, true/false/null and ? : ternaries), so 'javascript' highlights expressions correctly where 'python' would flag them as errors. Cosmetic only — both are valid CodeEditor modes. Addresses the Gemini review comment on PR #166. Also regenerates the README/index artifacts from the updated HISTORY fragments for both modules.
1 parent 31853ec commit ffd42c5

6 files changed

Lines changed: 46 additions & 4 deletions

File tree

spp_approval/README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ Dependencies
157157
Changelog
158158
=========
159159

160+
19.0.2.0.1
161+
~~~~~~~~~~
162+
163+
- Fix CEL Expressions tab crash: the ace editor fields used the invalid
164+
CodeEditor mode ``text``; changed to ``javascript`` (Odoo 19 only
165+
accepts ``javascript``/``xml``/``qweb``/``scss``/``python``).
166+
``javascript`` is used because the CEL dialect uses
167+
``&&``/``||``/``!``, ``true``/``false``/ ``null`` and ``? :``
168+
ternaries, which it highlights correctly.
169+
160170
19.0.2.0.0
161171
~~~~~~~~~~
162172

spp_approval/readme/HISTORY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
### 19.0.2.0.1
22

33
- Fix CEL Expressions tab crash: the ace editor fields used the invalid
4-
CodeEditor mode ``text``; changed to ``python`` (Odoo 19 only accepts
5-
``javascript``/``xml``/``qweb``/``scss``/``python``).
4+
CodeEditor mode ``text``; changed to ``javascript`` (Odoo 19 only accepts
5+
``javascript``/``xml``/``qweb``/``scss``/``python``). ``javascript`` is
6+
used because the CEL dialect uses ``&&``/``||``/``!``, ``true``/``false``/
7+
``null`` and ``? :`` ternaries, which it highlights correctly.
68

79
### 19.0.2.0.0
810

spp_approval/static/description/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,17 @@ <h2><a class="toc-backref" href="#toc-entry-1">Changelog</a></h2>
536536
</div>
537537
</div>
538538
<div class="section" id="section-1">
539+
<h1>19.0.2.0.1</h1>
540+
<ul class="simple">
541+
<li>Fix CEL Expressions tab crash: the ace editor fields used the invalid
542+
CodeEditor mode <tt class="docutils literal">text</tt>; changed to <tt class="docutils literal">javascript</tt> (Odoo 19 only
543+
accepts <tt class="docutils literal">javascript</tt>/<tt class="docutils literal">xml</tt>/<tt class="docutils literal">qweb</tt>/<tt class="docutils literal">scss</tt>/<tt class="docutils literal">python</tt>).
544+
<tt class="docutils literal">javascript</tt> is used because the CEL dialect uses
545+
<tt class="docutils literal">&amp;&amp;</tt>/<tt class="docutils literal">||</tt>/<tt class="docutils literal">!</tt>, <tt class="docutils literal">true</tt>/<tt class="docutils literal">false</tt>/ <tt class="docutils literal">null</tt> and <tt class="docutils literal">? :</tt>
546+
ternaries, which it highlights correctly.</li>
547+
</ul>
548+
</div>
549+
<div class="section" id="section-2">
539550
<h1>19.0.2.0.0</h1>
540551
<ul class="simple">
541552
<li>Initial migration to OpenSPP2</li>

spp_approval/views/approval_definition_views_cel.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<field
1616
name="cel_condition"
1717
widget="ace"
18-
options="{'mode': 'python'}"
18+
options="{'mode': 'javascript'}"
1919
invisible="not use_cel_condition"
2020
placeholder="record.amount > 10000"
2121
/>
@@ -42,7 +42,7 @@
4242
<field
4343
name="cel_reviewer_expression"
4444
widget="ace"
45-
options="{'mode': 'python'}"
45+
options="{'mode': 'javascript'}"
4646
invisible="not use_cel_reviewer"
4747
placeholder="record.manager_id.user_id.id"
4848
/>

spp_hide_menus_base/README.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ Dependencies
103103
Changelog
104104
=========
105105

106+
19.0.2.0.1
107+
~~~~~~~~~~
108+
109+
- Keep hidden menus hidden after a module upgrade resets their
110+
``group_ids`` via XML. Re-applying now runs from ``_register_hook`` so
111+
it covers every upgrade path (immediate, ``base.module.upgrade``
112+
wizard, and CLI ``-u``), not just the immediate path handled by
113+
``next()``.
114+
106115
19.0.2.0.0
107116
~~~~~~~~~~
108117

spp_hide_menus_base/static/description/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,16 @@ <h2><a class="toc-backref" href="#toc-entry-1">Changelog</a></h2>
474474
</div>
475475
</div>
476476
<div class="section" id="section-1">
477+
<h1>19.0.2.0.1</h1>
478+
<ul class="simple">
479+
<li>Keep hidden menus hidden after a module upgrade resets their
480+
<tt class="docutils literal">group_ids</tt> via XML. Re-applying now runs from <tt class="docutils literal">_register_hook</tt> so
481+
it covers every upgrade path (immediate, <tt class="docutils literal">base.module.upgrade</tt>
482+
wizard, and CLI <tt class="docutils literal"><span class="pre">-u</span></tt>), not just the immediate path handled by
483+
<tt class="docutils literal">next()</tt>.</li>
484+
</ul>
485+
</div>
486+
<div class="section" id="section-2">
477487
<h1>19.0.2.0.0</h1>
478488
<ul class="simple">
479489
<li>Initial migration to OpenSPP2</li>

0 commit comments

Comments
 (0)