Bug: CEL Expressions tab crashes and hidden menus reset on upgrade#166
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the ace widget configuration for CEL fields to use python mode and adds logic to re-apply menu hiding settings during module upgrades. The reviewer recommends using javascript mode instead of python for CEL expressions to ensure correct syntax highlighting, as CEL's syntax aligns more closely with JavaScript.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 19.0 #166 +/- ##
=======================================
Coverage 73.06% 73.06%
=======================================
Files 1069 1069
Lines 62105 62120 +15
=======================================
+ Hits 45377 45390 +13
- Misses 16728 16730 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Findings: Returned to dev Kindly check @gonzalesedwin1123
|
1. spp_approval: change ace widget mode from 'text' to 'python' in CEL expression fields. Odoo 19 CodeEditor only accepts javascript/xml/qweb/scss/python — 'text' crashes with "Invalid props for component 'CodeEditor': 'mode' is not valid". 2. spp_hide_menus_base: re-apply hiding when module upgrade resets menu group_ids via XML (noupdate="0"). Previously, menus with state="hide" were skipped in hide_menus(), so an upgrade that re-applied the original group_ids left them visible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@anthonymarkQA the "Steps to reproduce were incomplete" which is why you couldn't reproduce it. I will update the steps and also add automated unit tests to validate this so it doesn't regress. |
|
@anthonymarkQA — I've updated the PR description with corrected reproduction steps for issue #1. The original steps were incomplete, which is why you couldn't replicate the CEL crash: the ace editor field is To reproduce on For issue #2 (hidden menus on upgrade): please note which upgrade path you used when you saw it reappear (the inline Apps "Upgrade" button vs. the upgrade-confirmation wizard vs. CLI |
Add a guardrail asserting the CEL Expressions view's ace fields use a CodeEditor-valid mode (regression test for the 'text' mode crash that broke the tab), plus unit and integration coverage for spp_hide_menus_base._reapply_hide() and the hide_menus() re-hide branch that runs after a module upgrade resets a menu's group_ids.
73c8be5 to
821aabd
Compare
…ister_hook next() only fires on the immediate install/upgrade path (button_immediate_*). Upgrades through the base.module.upgrade wizard or the CLI (-u) reload menu XML (noupdate="0"), resetting group_ids, but never call next() — so hidden menus reappeared after those upgrades. _register_hook runs at the end of every registry load (startup, install, upgrade — all paths), re-applying hiding regardless of how the upgrade was triggered.
|
Findings: QA passed Issue 1:
Issue 2:
@gonzalesedwin1123 @kneckinator feel free to merge if test steps are correct or sufficient enough. |
|
Thanks for the quick review @anthonymarkQA 🙏 |
Version bump so existing installs pick up the fixes on upgrade. The spp_approval bump is functional: the CEL view fix is an ir.ui.view (XML) change that only re-applies when the module version increases. Add matching HISTORY.md entries.
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.
|
Re: @gemini-code-assist's suggestion to use Confirmed against the parser ( |
1. CodeEditor crash on Approval Definition CEL Expressions tab
Steps to reproduce:
invisible="not use_cel_condition"(anduse_cel_*defaults toFalse), so theCodeEditorcomponent only mounts once the toggle is enabled. Opening the tab alone does not crash, which is why the issue could not be reproduced from the steps as originally written.Expected: The CEL expression editor renders normally
Actual: JS crash:
Invalid props for component 'CodeEditor': 'mode' is not validRoot cause:
spp_approval/views/approval_definition_views_cel.xmlusesoptions="{'mode': 'text'}"onwidget="ace"fields. Odoo 19'sCodeEditorcomponent only accepts modes:javascript,xml,qweb,scss,python.textis not a valid mode.2. Hidden menus become visible after module upgrade
Steps to reproduce:
Root cause: Module upgrade re-applies menu XML data (
noupdate="0"), resettinggroup_ids. Thehide_menus()hook inir.module.module.next()skips menus withstate="hide", so the reset is never corrected.