Skip to content

Conversation

@zamberjo
Copy link
Member

@zamberjo zamberjo commented Jul 9, 2025

Enhance column value handling in X2Many2DMatrixRenderer to support selection type

…2Many2DMatrixRenderer to support selection type
Copilot AI review requested due to automatic review settings July 9, 2025 13:19
@OCA-git-bot
Copy link
Contributor

Hi @JasminSForgeFlow,
some modules you are maintaining are being modified, check this out!

@zamberjo zamberjo changed the title [17.0 [17.0][web_widget_x2many_2d_matrix] Support selection type Jul 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the X2Many2DMatrixRenderer to use a switch on field type, extending support for selection fields alongside existing many2one handling.

  • Replaced an if check for many2one with a switch on record.fields[…].type
  • Preserved many2one logic and added a selection case to map selection values to their labels
Comments suppressed due to low confidence (1)

web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm.js:37

  • Add unit tests for the new selection case to verify that selection values are correctly mapped to their labels under various scenarios.
                case "selection": {

@zamberjo zamberjo changed the title [17.0][web_widget_x2many_2d_matrix] Support selection type [17.0][IMP] web_widget_x2many_2d_matrix: Support selection type Jul 9, 2025
@zamberjo
Copy link
Member Author

zamberjo commented Jul 9, 2025

Hi @hbrunn, could you please take a look at this when you have a moment?. Thanks in advance! 🙏

Copy link
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

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

I'd like to see a refactoring of this eventually such that column and row headers are rendered by the field type's widget, but that might be a bit too much to ask for this specific case.

Would be good to port to v18 too

@hbrunn
Copy link
Member

hbrunn commented Aug 8, 2025

@zamberjo this should be superseded with #3246

@zamberjo
Copy link
Member Author

I'll check it out.

@zamberjo
Copy link
Member Author

No doubt your solution is much more complete, so I’m canceling this. Thanks a lot for your contribution!

@zamberjo zamberjo closed this Aug 18, 2025
@zamberjo zamberjo deleted the 17.0-imp-widget-2d-matrix-fields-selection branch August 18, 2025 10:24
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.

3 participants