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] delete_records_safely_by_xml_id: Added functionality to also delete child records #279

Merged
merged 1 commit into from
Oct 14, 2022
Merged

[IMP] delete_records_safely_by_xml_id: Added functionality to also delete child records #279

merged 1 commit into from
Oct 14, 2022

Conversation

baguenth
Copy link
Member

This brings the functionality to be able to also delete child records when using delete_records_safely_by_xml_id.

The related issue / feature request is: #278

@funbaker
Copy link

Such a great PR. It's really annoying trying to migrate a View with inherited Views.

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

Make sense and the implementation will not generate regression.

thanks !

@pedrobaeza pedrobaeza merged commit ed16a02 into OCA:master Oct 14, 2022
@@ -2583,7 +2585,12 @@ def delete_records_safely_by_xml_id(env, xml_ids):
record = env.ref(xml_id, raise_if_not_found=False)
if not record:
continue
safe_unlink(record, do_raise=True)
if delete_childs:
child_and_parent_records = env["ir.ui.view"].search(
Copy link
Contributor

Choose a reason for hiding this comment

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

It's sad this improvement only applies to views, but ok.

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.

5 participants