Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] TextValueProvider: duplicate values in dropdown list #3843

Closed
wants to merge 1 commit into from

Conversation

dhrp-odoo
Copy link
Contributor

@dhrp-odoo dhrp-odoo commented Mar 15, 2024

Description:

Previously, when creating data validation with either a list of values or a range of values, it resulted in an error being thrown by the auto-complete dropdown. This occurred because the values were being used as keys, and by definition, having duplicate keys in a list is nonsensical.

This PR addresses the problem by eliminating duplicate values from the list.

Task: : 3768392

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Mar 15, 2024

@dhrp-odoo dhrp-odoo force-pushed the 17.0-fix-dropdown-list-duplicate-values-dhrp branch from d00a388 to 926668a Compare March 19, 2024 09:03
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

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

Looks good 👍

tests/composer/edition_plugin.test.ts Outdated Show resolved Hide resolved
src/plugins/ui_stateful/edition.ts Outdated Show resolved Hide resolved
@dhrp-odoo dhrp-odoo force-pushed the 17.0-fix-dropdown-list-duplicate-values-dhrp branch 2 times, most recently from a6b22af to 8f92f69 Compare March 22, 2024 09:27
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

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

Small comment then we're good :)

});

test("Duplicate values will be removed before sending proposals to the autocomplete dropdown in data validation with list", async () => {
addDataValidation(model, "A1", "id", {
Copy link
Contributor

Choose a reason for hiding this comment

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

also test that the data validation plugin has the filtered values since you filter them in the plugin now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a test for the plugin, thanks!

Previously, when creating data validation with either a list of values
or a range of values, it resulted in an error being thrown by the
auto-complete dropdown. This occurred because the values were being used
as keys, and by definition, having duplicate keys in a list is nonsensical.

This commit addresses the problem by eliminating duplicate values from
the list.

TaskID: 3768392
@dhrp-odoo dhrp-odoo force-pushed the 17.0-fix-dropdown-list-duplicate-values-dhrp branch from 8f92f69 to 088e01f Compare March 26, 2024 07:31
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

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

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.

None yet

3 participants