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

SQL constraint error messages are not parsed correctly anymore when there's an unique index #73448

Open
luisg123v opened this issue Jul 8, 2021 · 1 comment

Comments

@luisg123v
Copy link
Contributor

luisg123v commented Jul 8, 2021

Impacted versions:

  • 14.0
  • 13.0

Steps to reproduce:

  • Go to Settings -> User Interface -> User-defined Filters
  • Open any filter (e.g. "By Country")
  • Duplicate the filter and save it with the same name as the original one

Current behavior:
The following error message is shown:

duplicate key value violates unique constraint "ir_filters_name_model_uid_unique_action_index"
DETAIL: Key (lower(name::text), model_id, COALESCE(user_id, '-1'::integer), COALESCE(action_id, '-1'::integer))=(by country (copy), account.invoice.report, -1, -1) already exists.

Expected behavior:
The message "ilter names must be unique" should be shown, instead of the raw SQL constraint.

The message is defined on this SQL constraint. Since there's an unique index and they share the same prefix, the SQL constraint's error message should be used when the unique index is triggered.

This worked correctly in Odoo < 13.0

Video/Screenshot link (optional):
Plain SQL constraint

Support ticket number submitted via odoo.com/help (optional):
OPW #2596482

@luisg123v
Copy link
Contributor Author

CC @angelJuaGar @moylop260 @hugho-ad

@luisg123v luisg123v changed the title SQL constraint error messages are not parsed correctly anymore when ther's an unique index SQL constraint error messages are not parsed correctly anymore when there's an unique index Jul 8, 2021
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

No branches or pull requests

1 participant