Skip to content

fix(spp_programs): fix in-kind entitlement item form layout and product domain#24

Merged
gonzalesedwin1123 merged 6 commits into19.0from
fix/inkind-entitlement-item-form-layout
Feb 19, 2026
Merged

fix(spp_programs): fix in-kind entitlement item form layout and product domain#24
gonzalesedwin1123 merged 6 commits into19.0from
fix/inkind-entitlement-item-form-layout

Conversation

@emjay0921
Copy link
Contributor

Why is this change needed?

The in-kind entitlement manager's item form had several UI issues:

  • The form layout did not match the wizard's layout (flat structure vs organized groups)
  • Product selection showed no products because the domain filter used type=product (removed in Odoo 19, renamed to consu)
  • The Condition section was visually skewed — the CEL expression widget rendered above the radio buttons instead of below

How was the change implemented?

  • Form layout: Restructured the inline <form> in entitlement_manager_inkind_view.xml to use properly organized <group> elements matching the wizard's layout
  • Product domain: Changed domain=[("type", "=", "product")] to domain=[("type", "=", "consu")] in both entitlement_manager_inkind.py and entitlement.py to match Odoo 19's product type naming
  • Condition section: Wrapped the condition fields in <group name="condition_section" col="1"> so Odoo's form renderer enforces proper vertical ordering; added nolabel="1" to CEL-inserted fields in entitlement_inkind_cel_views.xml for full-width rendering

New unit tests

Unit tests executed by the author

How to test manually

  1. Go to Programs > Configuration > In-Kind Entitlement Managers
  2. Open a manager and click "Add a line" on the Items table
  3. Verify the Product field shows products (storable/consumable)
  4. Verify the form layout matches the wizard (Product on top, Quantity/UoM side-by-side, Condition below)
  5. Switch Condition to "CEL Expression" — verify the expression field appears below the radio buttons

Related links

@gemini-code-assist
Copy link

Summary of Changes

Hello @emjay0921, 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 several UI and compatibility issues within the in-kind entitlement manager's item form. It updates the product domain filter to align with Odoo 19, restructures the form layout for better organization, and resolves visual alignment problems in the condition section. These changes collectively enhance the form's functionality and user interface.

Highlights

  • Product Domain Update: The product selection domain filter has been updated from type=product to type=consu to ensure compatibility with Odoo 19's product type naming conventions, resolving an issue where no products were displayed.
  • Form Layout Restructuring: The in-kind entitlement item form layout has been reorganized using <group> elements to match the wizard's structure, improving visual consistency and user experience.
  • Condition Section Visual Fix: The Condition section's visual skew has been corrected by wrapping condition fields in a dedicated <group> and adding nolabel='1' to CEL-inserted fields, ensuring proper vertical ordering and full-width rendering.
Changelog
  • spp_programs/models/entitlement.py
    • Updated product domain filter from 'product' to 'consu' for Odoo 19 compatibility.
  • spp_programs/models/managers/entitlement_manager_inkind.py
    • Adjusted product domain filter from 'product' to 'consu' to align with Odoo 19 product types.
  • spp_programs/views/cel/entitlement_inkind_cel_views.xml
    • Added nolabel='1' attribute to condition_mode and condition_cel_expression fields for proper rendering.
    • Applied XML formatting adjustments for readability.
  • spp_programs/views/managers/entitlement_manager_inkind_view.xml
    • Restructured the in-kind entitlement item form layout using <group> elements for better organization.
    • Introduced a separator for the 'Condition (Optional)' section.
    • Wrapped the condition field in a dedicated group and added nolabel='1' for visual alignment.
    • Applied XML formatting adjustments for readability.
Activity
  • No human activity has occurred on this pull request yet.
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

@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 effectively addresses the UI layout issues in the in-kind entitlement item form and corrects the product domain filter for Odoo 19 compatibility. The XML view has been well-restructured using standard Odoo practices to improve the form's organization and fix rendering problems with the CEL widget. The Python changes are correct and necessary. Overall, these are solid fixes that improve both the user experience and maintainability of the code.

Kept PR's nolabel attribute on condition_mode and
condition_cel_expression fields.
@gonzalesedwin1123 gonzalesedwin1123 merged commit d681f77 into 19.0 Feb 19, 2026
9 of 10 checks passed
@gonzalesedwin1123 gonzalesedwin1123 deleted the fix/inkind-entitlement-item-form-layout branch February 19, 2026 06:56
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.61%. Comparing base (0cbb46f) to head (d41ac86).
⚠️ Report is 19 commits behind head on 19.0.

Additional details and impacted files
@@            Coverage Diff             @@
##             19.0      #24      +/-   ##
==========================================
+ Coverage   68.93%   69.61%   +0.67%     
==========================================
  Files         302      359      +57     
  Lines       24303    27980    +3677     
==========================================
+ Hits        16754    19479    +2725     
- Misses       7549     8501     +952     
Flag Coverage Δ
spp_api_v2 89.14% <ø> (ø)
spp_api_v2_change_request 66.61% <ø> (ø)
spp_api_v2_cycles 65.45% <ø> (ø)
spp_api_v2_data 48.67% <ø> (ø)
spp_api_v2_entitlements 68.43% <ø> (ø)
spp_api_v2_products 64.39% <ø> (ø)
spp_api_v2_service_points 63.12% <ø> (ø)
spp_api_v2_vocabulary 43.70% <ø> (ø)
spp_audit 69.47% <ø> (ø)
spp_base_common 92.81% <ø> (?)
spp_cel_event 81.23% <ø> (?)
spp_claim_169 63.78% <ø> (?)
spp_dci_client_dr 75.33% <ø> (?)
spp_programs 49.56% <100.00%> (ø)
spp_security 51.08% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

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

Comments