Skip to content

fix(spp_cel_vocabulary,spp_gis_indicators): beta promotion and fixes#89

Merged
emjay0921 merged 7 commits into19.0from
fix/gis-indicators-view-mode-tree-to-list
Mar 11, 2026
Merged

fix(spp_cel_vocabulary,spp_gis_indicators): beta promotion and fixes#89
emjay0921 merged 7 commits into19.0from
fix/gis-indicators-view-mode-tree-to-list

Conversation

@emjay0921
Copy link
Copy Markdown
Contributor

@emjay0921 emjay0921 commented Mar 11, 2026

Why is this change needed?

Promote spp_cel_vocabulary and spp_gis_indicators from Alpha to Beta, with bug fixes and code quality improvements.

How was the change implemented?

spp_cel_vocabulary:

  • Promote to Beta
  • Rename display_name to label in concept group definitions
  • Remove unused semantic helpers (is_caregiver, is_mother, is_father)
  • Replace f-string logging with lazy % formatting

spp_gis_indicators:

  • Promote to Beta
  • Add spp_security dependency
  • Fix view_mode from tree,form to list,form (Odoo 19 compatibility)
  • Rewrite data_layer.py with choropleth validation constraint
  • Add _get_choropleth_config() override for indicator-based config
  • Fix None value handling in legend generation
  • Improve tests with shared helper and 3 new test cases

New unit tests

  • test_choropleth_requires_config — validates choropleth without config raises error
  • test_get_choropleth_config_indicator — validates indicator-based choropleth config
  • test_get_choropleth_config_basic — validates basic layers return no choropleth config

Unit tests executed by the author

How to test manually

  • Navigate to Settings > GIS Configuration > Indicator Layers — should open without error
  • Navigate to Settings > GIS Configuration > Color Scales — should open without error
  • Check concept groups at Settings > Vocabularies > Concept Groups

Related links

Odoo 19 no longer supports 'tree' in view_mode for act_window actions.
Changed to 'list,form' to fix "View types not defined tree" error.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical compatibility issue with Odoo 19 by adjusting the view mode definitions for GIS configuration actions. The change ensures that users can access Indicator Layers and Color Scales without encountering errors related to deprecated view types, thereby maintaining the functionality of these modules in the updated Odoo environment.

Highlights

  • Odoo 19 Compatibility: Updated view_mode from tree to list in action definitions to resolve compatibility issues with Odoo 19, which no longer supports tree in ir.actions.act_window records.
  • Error Resolution: Fixed an error where opening Indicator Layers or Color Scales menus would throw View types not defined tree found in act_window action.
Changelog
  • spp_gis_indicators/views/color_scale_views.xml
    • Updated the view_mode field from tree,form to list,form for the 'Color Scales' action.
  • spp_gis_indicators/views/indicator_layer_views.xml
    • Updated the view_mode field from tree,form to list,form for the 'Indicator Layers' action.
Activity
  • New unit tests were not added, as indicated by the 'New unit tests' section being empty.
  • Unit tests were executed by the author to verify the changes.
  • Manual testing steps were provided to confirm the fix for 'Indicator Layers' and 'Color Scales' menus.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a compatibility issue with Odoo 19 by replacing the deprecated tree view mode with list in the ir.actions.act_window records for color scales and indicator layers. The changes in color_scale_views.xml and indicator_layer_views.xml are accurate and resolve the described error. The implementation is correct and no issues were found.

Note: Security Review has been skipped due to the limited scope of the PR.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.91%. Comparing base (3068522) to head (4499a9c).
⚠️ Report is 8 commits behind head on 19.0.

Files with missing lines Patch % Lines
spp_gis_indicators/models/indicator_layer.py 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0      #89      +/-   ##
==========================================
+ Coverage   69.67%   69.91%   +0.24%     
==========================================
  Files         666      674       +8     
  Lines       36682    37005     +323     
==========================================
+ Hits        25558    25872     +314     
- Misses      11124    11133       +9     
Flag Coverage Δ
spp_base_common 90.26% <ø> (ø)
spp_cel_vocabulary 95.08% <100.00%> (?)
spp_gis_indicators 91.07% <95.23%> (+3.03%) ⬆️
spp_programs 45.51% <ø> (ø)
spp_security 66.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_cel_vocabulary/__init__.py 100.00% <ø> (ø)
spp_cel_vocabulary/__manifest__.py 0.00% <ø> (ø)
..._cel_vocabulary/models/cel_vocabulary_functions.py 100.00% <100.00%> (ø)
...cel_vocabulary/models/cel_vocabulary_translator.py 95.52% <100.00%> (ø)
...el_vocabulary/services/cel_vocabulary_functions.py 94.11% <100.00%> (ø)
spp_gis_indicators/__manifest__.py 0.00% <ø> (ø)
spp_gis_indicators/models/data_layer.py 100.00% <100.00%> (ø)
spp_gis_indicators/models/indicator_layer.py 87.71% <50.00%> (+3.69%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ixes

spp_cel_vocabulary:
- Promote to Beta
- Rename display_name to label in concept group definitions
- Remove unused semantic helpers (is_caregiver, is_mother, is_father)
- Replace f-string logging with lazy % formatting

spp_gis_indicators:
- Promote to Beta
- Add spp_security dependency
- Rewrite data_layer with choropleth validation constraint
- Add _get_choropleth_config() override for indicator-based config
- Fix None value handling in legend generation
- Improve tests with shared helper and 3 new test cases
@emjay0921 emjay0921 changed the title fix(spp_gis_indicators): use list instead of tree in view_mode fix(spp_cel_vocabulary,spp_gis_indicators): beta promotion and fixes Mar 11, 2026
spp_cel_vocabulary (34 new tests):
- _ensure_concept_groups() idempotency and completeness
- _ensure_registered() lazy registration mechanism
- head() function: missing code, _membership/_group params, fallbacks
- VocabularyCache.clear() reset behavior
- Translator error paths: unknown helpers, empty groups, unsupported ops
- code() function edge cases with falsy values
- post_init_hook() integration

spp_gis_indicators (27 new tests):
- Quantile breaks: empty values, few unique values
- Legend HTML: empty breaks, missing color scale
- get_feature_colors(): no indicators, None values, value=0, boundaries
- _get_indicator_values(): incident filter, empty period
- _compute_break_values(): no data, unknown classification
- Color scale: diverging edge cases, exact boundaries
- colors_json validation: empty string, short hex
…RIPTION

Markdown tables in DESCRIPTION.md cause RST column width differences
between local and CI versions of oca-gen-addon-readme. Using bullet
lists avoids the issue entirely.
…tch coverage

Add targeted tests to cover changed lines in:
- data_layer.py: _get_choropleth_config and _check_choropleth_config using new() records
- cel_vocabulary_translator.py: error paths for field resolution, eval, and code lookup
- indicator_layer.py: get_feature_colors with zero and positive values
@emjay0921 emjay0921 merged commit ae00c8a into 19.0 Mar 11, 2026
20 checks passed
@emjay0921 emjay0921 deleted the fix/gis-indicators-view-mode-tree-to-list branch March 11, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants