fix(spp_studio_events): clarify Create Event step 1 for Studio types (#992)#191
fix(spp_studio_events): clarify Create Event step 1 for Studio types (#992)#191
Conversation
… applicable When clicking the **Event Data** button on a registrant form (individual or group), the wizard that opened was the basic `spp.create.event.wizard` — which only exposes a raw JSON input field. Studio-defined event types and their structured field configurations (label, type, required flag, group, etc.) were ignored on this entry path, leaving Studio event types effectively unusable from the Individuals view. Override `res.partner.open_create_event_wizard` in `spp_studio_events`: - If any active Studio event type matches the registrant's target_type (`individual`, `group`, or `both`), open `spp.event.data.entry.wizard` with `default_partner_id` set. The Studio wizard renders each defined field as its own form input. - Otherwise, fall back to `super()` so the legacy basic wizard still serves non-Studio (manual / dedicated-model) event types — no regression for deployments that haven't adopted Studio. The redirect logic that already lived in `create_event_wizard.create_event()` still works as a safety net for any other entry point that lands on the basic wizard with a Studio-backed event_type_id selected. Bumps spp_studio_events 19.0.2.0.0 → 19.0.2.0.1. Refs OP#992.
Clicking the **Events** smart button on a Studio Event Type form crashed with `UncaughtPromiseError: View types not defined tree found in act_window action`. The action returned `view_mode="tree,form"`, but Odoo 19 renamed `tree` to `list` — the client-side action handler can no longer resolve the view. One-line swap to `view_mode="list,form"` per OP#993's suggested fix. The `<list>` tag inside view arch XML is unaffected; only `view_mode` on `ir.actions.act_window` payloads needs the new name. Refs OP#993.
…ard when applicable" This reverts commit 148db5aa3140862ddb98ff6a09a45ed94e8aa00d. The override of `res.partner.open_create_event_wizard` introduced problems beyond the original OP#992 scope (flagged on the ticket). Reverting to the pre-#992 behaviour so we can re-evaluate the right fix from the initial buggy state — the basic wizard's raw-JSON entry on Studio event types is still the original bug to address, just not via this routing override. Kept on this branch: - The OP#993 fix (action_view_events `view_mode="tree,form"` → `"list,form"`), which is unrelated to the Event Data button routing. - The version bump to 19.0.2.0.1 (still warranted by #993). - The HISTORY entry, with only the #993 bullet under 19.0.2.0.1. Removed: - `spp_studio_events/models/res_partner.py` - The `from . import res_partner` line in `models/__init__.py` - The OP#992 HISTORY bullet. Refs OP#992.
…nt types (OP#992)
There was a problem hiding this comment.
Code Review
This pull request enhances the 'Create Event' wizard for Studio-backed event types by introducing a multi-step UI that hides raw JSON fields and adds helpful guidance. It also fixes a crash when viewing events by updating the view mode to 'list' for Odoo 19 compatibility. Feedback from the review indicates that the documentation files, specifically the README and its generated HTML description, have corrupted table formatting where reduced column widths have broken code literals and syntax.
| +----------------------------------+----------------------------------+ | ||
| | Model | Description | | ||
| +==================================+==================================+ | ||
| | ``spp.studio.event.type`` | Custom event type definition | | ||
| | | with draft/active lifecycle | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``spp.studio.event.field`` | Field definition with type, | | ||
| | | validation, and visibility | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``spp.studio.event.field.group`` | Groups fields into tabs in the | | ||
| | | data entry wizard | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``s | Reusable template containing | | ||
| | pp.studio.event.field.template`` | field definitions | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``spp.st | Field definition within a | | ||
| | udio.event.field.template.line`` | template | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``spp.studio.event.type.wizard`` | 3-step wizard for creating event | | ||
| | | types | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``spp.event.data.entry.wizard`` | Generated wizard for entering | | ||
| | | event data | | ||
| +----------------------------------+----------------------------------+ |
There was a problem hiding this comment.
The 'Key Models' table formatting is corrupted. The reduction in column width has caused long model names to wrap incorrectly, splitting the double-backtick literals (e.g., lines 65-66 and 68-69). This is invalid reStructuredText and will not render correctly. Please restore the column widths to accommodate the full model names without wrapping inside the literals.
+------------------------------------------+----------------------------------+
| Model | Description |
+==========================================+==================================+
| spp.studio.event.type | Custom event type definition |
| | with draft/active lifecycle |
+------------------------------------------+----------------------------------+
| spp.studio.event.field | Field definition with type, |
| | validation, and visibility |
+------------------------------------------+----------------------------------+
| spp.studio.event.field.group | Groups fields into tabs in the |
| | data entry wizard |
+------------------------------------------+----------------------------------+
| spp.studio.event.field.template | Reusable template containing |
| | field definitions |
+------------------------------------------+----------------------------------+
| spp.studio.event.field.template.line | Field definition within a |
| | template |
+------------------------------------------+----------------------------------+
| spp.studio.event.type.wizard | 3-step wizard for creating event |
| | types |
+------------------------------------------+----------------------------------+
| spp.event.data.entry.wizard | Generated wizard for entering |
| | event data |
+------------------------------------------+----------------------------------+
References
- Manual changes to files generated by oca-gen-addon-readme will be overwritten. Ensure the source formatting is correct.
| +----------------------------------+----------------------------------+ | ||
| | Group | Access | | ||
| +==================================+==================================+ | ||
| | `` | Read event types and templates | | ||
| | spp_studio.group_studio_viewer`` | | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``spp_stud | Read/Write/Create on event | | ||
| | io.group_studio_editor_officer`` | types, fields, and templates (no | | ||
| | | delete on event | | ||
| | | types/fields/templates) | | ||
| +----------------------------------+----------------------------------+ | ||
| | ``s | Full CRUD | | ||
| | pp_studio.group_studio_manager`` | | | ||
| +----------------------------------+----------------------------------+ |
There was a problem hiding this comment.
The 'Security' table formatting is also corrupted. Similar to the 'Key Models' table, the column width reduction has caused literals to be split across lines (e.g., lines 105-106, 108-109, 113-114), which breaks the RST syntax. Please fix the table layout.
| +----------------------------------+----------------------------------+ | |
| | Group | Access | | |
| +==================================+==================================+ | |
| | `` | Read event types and templates | | |
| | spp_studio.group_studio_viewer`` | | | |
| +----------------------------------+----------------------------------+ | |
| | ``spp_stud | Read/Write/Create on event | | |
| | io.group_studio_editor_officer`` | types, fields, and templates (no | | |
| | | delete on event | | |
| | | types/fields/templates) | | |
| +----------------------------------+----------------------------------+ | |
| | ``s | Full CRUD | | |
| | pp_studio.group_studio_manager`` | | | |
| +----------------------------------+----------------------------------+ | |
| +--------------------------------------------+----------------------------------+ | |
| | Group | Access | | |
| +============================================+==================================+ | |
| | spp_studio.group_studio_viewer | Read event types and templates | | |
| +--------------------------------------------+----------------------------------+ | |
| | spp_studio.group_studio_editor_officer | Read/Write/Create on event | | |
| | | types, fields, and templates (no | | |
| | | delete on event | | |
| | | types/fields/templates) | | |
| +--------------------------------------------+----------------------------------+ | |
| | spp_studio.group_studio_manager | Full CRUD | | |
| +--------------------------------------------+----------------------------------+ |
References
- Manual changes to files generated by oca-gen-addon-readme will be overwritten. Ensure the source formatting is correct.
| <tr><td><tt class="docutils literal">s | ||
| pp.studio.event.field.template</tt></td> | ||
| <td>Reusable template containing | ||
| field definitions</td> | ||
| </tr> | ||
| <tr><td><tt class="docutils literal">spp.studio.event.field.template.line</tt></td> | ||
| <tr><td><tt class="docutils literal">spp.st | ||
| udio.event.field.template.line</tt></td> | ||
| <td>Field definition within a | ||
| template</td> | ||
| </tr> |
There was a problem hiding this comment.
The HTML table for 'Key Models' is corrupted. The model names are split across lines and the tags have been replaced with raw backticks (``), which are not valid HTML for code literals. This suggests a broken documentation generation process or an incorrect manual edit. Please regenerate this file after fixing the source README.rst.
References
- Manual changes to auto-generated files like index.html will be overwritten. Fixes should be applied to the source README.rst.
| <tr><td>`` | ||
| spp_studio.group_studio_viewer``</td> | ||
| <td>Read event types and templates</td> | ||
| </tr> | ||
| <tr><td><tt class="docutils literal">spp_studio.group_studio_editor_officer</tt></td> | ||
| <tr><td><tt class="docutils literal">spp_stud | ||
| io.group_studio_editor_officer</tt></td> | ||
| <td>Read/Write/Create on event | ||
| types, fields, and templates (no | ||
| delete on event | ||
| types/fields/templates)</td> | ||
| </tr> | ||
| <tr><td><tt class="docutils literal">spp_studio.group_studio_manager</tt></td> | ||
| <tr><td><tt class="docutils literal">s | ||
| pp_studio.group_studio_manager</tt></td> |
There was a problem hiding this comment.
The 'Security' table in the HTML description is corrupted. Raw backticks are used instead of proper HTML tags for code literals, and the content is incorrectly wrapped. Please ensure the HTML is correctly generated by fixing the source README.rst, as manual changes to this file will be overwritten.
References
- Manual changes to auto-generated files like index.html will be overwritten. Fixes should be applied to the source README.rst.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 19.0 #191 +/- ##
==========================================
- Coverage 71.69% 71.68% -0.01%
==========================================
Files 942 952 +10
Lines 55561 56436 +875
==========================================
+ Hits 39835 40458 +623
- Misses 15726 15978 +252
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Why is this change needed?
The Event Data button on the registrant form opens the basic
spp.create.event.wizard. Step 1 of that wizard exposes a raw JSONevent_datainput and a Create Event button — both of which are misleading when the selected event type is Studio-backed:spp.event.data.entry.wizardthatcreate_event()forwards to), not stage 1.QA Round 1 attempted to fix this by overriding
res.partner.open_create_event_wizardto bypass the basic wizard entirely for Studio types — but that bypass also removed the event-type picker, breaking the single, consistent entry point for both Studio and non-Studio types. That override is reverted in this PR.How was the change implemented?
Step 1 of the basic wizard now adapts to the selected event type:
is_studio_event_typeonspp.create.event.wizardreturns true when the picked event type has an activespp.studio.event.type.wizard/create_event_wizard_views.xml) inheritingspp_event_data.view_spp_create_event_wizard_form:event_datagroup whenis_studio_event_type.create_eventbacking method, so the existing redirect-to-Studio-wizard logic still fires).Bumps
spp_studio_events19.0.2.0.1 → 19.0.2.0.2.New unit tests
None — the change is XML view inheritance + a one-line computed field. Behaviour was validated manually on a
./spp start --wipeinstance against the full QA matrix below (Studio individual, Studio group, non-Studio fallback, empty state).Unit tests executed by the author
spp_studio_eventstest suite (no new tests added; existing coverage on_get_active_studio_event_typeis unchanged).How to test manually
See the Round 2 QA test guide on OP#992 for the full matrix. Summary:
./spp start --wipe→ installspp_studio_events.Target Type = Individual.Related links