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

[IMP] base: allow configure models that can be deleted in partner merging #575

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

fernandahf
Copy link

Description of the issue/feature this PR addresses:

The method _update_reference_fields is handling PSQL errors in the case in the middle of updating something fails and it's deleting indiscriminately the records involved presuming that PSQL error is always a unique violation, but can occur any PSQL error, so this change is allowing configure what models can be deleted in a unique violation if the models are not defined, it's working as currently, otherwise, it's validating the model and raising an error in case model is not in allowed ones.

Current behavior before PR:

When a merge occurs, if there is a PostgreSQL error in updating reference fields, the records involved are deleted.

Desired behavior after PR is merged:

When a merge occurs, if there is a PostgreSQL unique violation error in updating reference fields and the parameter is base_partner_merge.models_allowed_to_unlink is configured, if records involved are in allowed models to delete, then delete them, otherwise raise an error to the user can review at detail.

OPW: Pending

…gings

The method `_update_reference_fields` is handling psql errors
in case in middle of updating something fails and it's deleting
indiscriminately the records involved presuming that psql error is always
a unique violation, but can ocurrs any psql error, so this change is allowing
configure what models can be deleted in an unique violation, if the models
are not defined, it's working as currently, otherwise it's validating the model
and raising an error in case model is not in allowed ones.
@fernandahf fernandahf changed the title [IMP] base: allow configure models that can be deleted in partner mer… [IMP] base: allow configure models that can be deleted in partner merging Jan 5, 2024
@fernandahf
Copy link
Author

For record:

PR to Odoo:

odoo#148387

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.

1 participant