{"action":"created","comment":{"url":"https://api.github.com/repos/odoo/odoo/pulls/comments/82970176","pull_request_review_id":3839443,"id":82970176,"diff_hunk":"@@ -1208,6 +1208,7 @@ def _module_data_uninstall(self, modules_to_remove):\n         datas = self.search([('module', 'in', modules_to_remove)])\n         wkf_todo = []\n         to_unlink = tools.OrderedSet()\n+        undeletable = []","path":"odoo/addons/base/ir/ir_model.py","position":4,"original_position":4,"commit_id":"1159546430f7c0b8e65e85d42818f533a729763b","original_commit_id":"1159546430f7c0b8e65e85d42818f533a729763b","user":{"login":"rco-odoo","id":7578141,"avatar_url":"https://avatars.githubusercontent.com/u/7578141?v=3","gravatar_id":"","url":"https://api.github.com/users/rco-odoo","html_url":"https://github.com/rco-odoo","followers_url":"https://api.github.com/users/rco-odoo/followers","following_url":"https://api.github.com/users/rco-odoo/following{/other_user}","gists_url":"https://api.github.com/users/rco-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/rco-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rco-odoo/subscriptions","organizations_url":"https://api.github.com/users/rco-odoo/orgs","repos_url":"https://api.github.com/users/rco-odoo/repos","events_url":"https://api.github.com/users/rco-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/rco-odoo/received_events","type":"User","site_admin":false},"body":"This list of `(model, res_id)` looks a bit inefficient to me. It also makes the `filter` below a bit tricky.\r\nWhy don't you make a recordset, like this?\r\n```python\r\nundeletable = self.browse()\r\n```","created_at":"2016-10-12T09:41:32Z","updated_at":"2016-10-12T09:41:32Z","html_url":"https://github.com/odoo/odoo/pull/12954#discussion_r82970176","pull_request_url":"https://api.github.com/repos/odoo/odoo/pulls/12954","_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments/82970176"},"html":{"href":"https://github.com/odoo/odoo/pull/12954#discussion_r82970176"},"pull_request":{"href":"https://api.github.com/repos/odoo/odoo/pulls/12954"}}},"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/12954","id":79221586,"html_url":"https://github.com/odoo/odoo/pull/12954","diff_url":"https://github.com/odoo/odoo/pull/12954.diff","patch_url":"https://github.com/odoo/odoo/pull/12954.patch","issue_url":"https://api.github.com/repos/odoo/odoo/issues/12954","number":12954,"state":"open","locked":false,"title":"[FIX] don't delete the xmlid of an undeletable record","user":{"login":"hbrunn","id":2563186,"avatar_url":"https://avatars.githubusercontent.com/u/2563186?v=3","gravatar_id":"","url":"https://api.github.com/users/hbrunn","html_url":"https://github.com/hbrunn","followers_url":"https://api.github.com/users/hbrunn/followers","following_url":"https://api.github.com/users/hbrunn/following{/other_user}","gists_url":"https://api.github.com/users/hbrunn/gists{/gist_id}","starred_url":"https://api.github.com/users/hbrunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbrunn/subscriptions","organizations_url":"https://api.github.com/users/hbrunn/orgs","repos_url":"https://api.github.com/users/hbrunn/repos","events_url":"https://api.github.com/users/hbrunn/events{/privacy}","received_events_url":"https://api.github.com/users/hbrunn/received_events","type":"User","site_admin":false},"body":"Description of the issue/feature this PR addresses: When a record pointed to by an xmlid is not deletable during module uninstallation, the record is kept, but the xmlid is deleted. This leads to trouble when reinstalling the module, because then said record is duplicated.\r\nI couldn't find an example with core module, but in case there's some uniqueness constraint on the table in question, reinstallation wil actually fail because the record still exists, but Odoo will try to recreate it as the accompanying xmlid is gone.\r\n\r\nCurrent behavior before PR: When a record pointed to by an xmlid cannot be deleted, the xmlid is deleted\r\n\r\nDesired behavior after PR is merged: The xmlid is kept for further reference if the record pointed to cannot be deleted.\r\n\r\n\r\n--\r\nI confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr\r\n\r\n","created_at":"2016-07-28T15:54:21Z","updated_at":"2016-10-12T09:41:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b64ed6fe788b6c349b84b6b4a7f8d1dd0cc94146","assignee":{"login":"rco-odoo","id":7578141,"avatar_url":"https://avatars.githubusercontent.com/u/7578141?v=3","gravatar_id":"","url":"https://api.github.com/users/rco-odoo","html_url":"https://github.com/rco-odoo","followers_url":"https://api.github.com/users/rco-odoo/followers","following_url":"https://api.github.com/users/rco-odoo/following{/other_user}","gists_url":"https://api.github.com/users/rco-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/rco-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rco-odoo/subscriptions","organizations_url":"https://api.github.com/users/rco-odoo/orgs","repos_url":"https://api.github.com/users/rco-odoo/repos","events_url":"https://api.github.com/users/rco-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/rco-odoo/received_events","type":"User","site_admin":false},"assignees":[{"login":"rco-odoo","id":7578141,"avatar_url":"https://avatars.githubusercontent.com/u/7578141?v=3","gravatar_id":"","url":"https://api.github.com/users/rco-odoo","html_url":"https://github.com/rco-odoo","followers_url":"https://api.github.com/users/rco-odoo/followers","following_url":"https://api.github.com/users/rco-odoo/following{/other_user}","gists_url":"https://api.github.com/users/rco-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/rco-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rco-odoo/subscriptions","organizations_url":"https://api.github.com/users/rco-odoo/orgs","repos_url":"https://api.github.com/users/rco-odoo/repos","events_url":"https://api.github.com/users/rco-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/rco-odoo/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/odoo/odoo/pulls/12954/commits","review_comments_url":"https://api.github.com/repos/odoo/odoo/pulls/12954/comments","review_comment_url":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/12954/comments","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/1159546430f7c0b8e65e85d42818f533a729763b","head":{"label":"hbrunn:master-keep-xmlids-of-undeletable-records","ref":"master-keep-xmlids-of-undeletable-records","sha":"1159546430f7c0b8e65e85d42818f533a729763b","user":{"login":"hbrunn","id":2563186,"avatar_url":"https://avatars.githubusercontent.com/u/2563186?v=3","gravatar_id":"","url":"https://api.github.com/users/hbrunn","html_url":"https://github.com/hbrunn","followers_url":"https://api.github.com/users/hbrunn/followers","following_url":"https://api.github.com/users/hbrunn/following{/other_user}","gists_url":"https://api.github.com/users/hbrunn/gists{/gist_id}","starred_url":"https://api.github.com/users/hbrunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbrunn/subscriptions","organizations_url":"https://api.github.com/users/hbrunn/orgs","repos_url":"https://api.github.com/users/hbrunn/repos","events_url":"https://api.github.com/users/hbrunn/events{/privacy}","received_events_url":"https://api.github.com/users/hbrunn/received_events","type":"User","site_admin":false},"repo":{"id":21851400,"name":"OCB","full_name":"hbrunn/OCB","owner":{"login":"hbrunn","id":2563186,"avatar_url":"https://avatars.githubusercontent.com/u/2563186?v=3","gravatar_id":"","url":"https://api.github.com/users/hbrunn","html_url":"https://github.com/hbrunn","followers_url":"https://api.github.com/users/hbrunn/followers","following_url":"https://api.github.com/users/hbrunn/following{/other_user}","gists_url":"https://api.github.com/users/hbrunn/gists{/gist_id}","starred_url":"https://api.github.com/users/hbrunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbrunn/subscriptions","organizations_url":"https://api.github.com/users/hbrunn/orgs","repos_url":"https://api.github.com/users/hbrunn/repos","events_url":"https://api.github.com/users/hbrunn/events{/privacy}","received_events_url":"https://api.github.com/users/hbrunn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hbrunn/OCB","description":"Odoo Community Backports","fork":true,"url":"https://api.github.com/repos/hbrunn/OCB","forks_url":"https://api.github.com/repos/hbrunn/OCB/forks","keys_url":"https://api.github.com/repos/hbrunn/OCB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hbrunn/OCB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hbrunn/OCB/teams","hooks_url":"https://api.github.com/repos/hbrunn/OCB/hooks","issue_events_url":"https://api.github.com/repos/hbrunn/OCB/issues/events{/number}","events_url":"https://api.github.com/repos/hbrunn/OCB/events","assignees_url":"https://api.github.com/repos/hbrunn/OCB/assignees{/user}","branches_url":"https://api.github.com/repos/hbrunn/OCB/branches{/branch}","tags_url":"https://api.github.com/repos/hbrunn/OCB/tags","blobs_url":"https://api.github.com/repos/hbrunn/OCB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hbrunn/OCB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hbrunn/OCB/git/refs{/sha}","trees_url":"https://api.github.com/repos/hbrunn/OCB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hbrunn/OCB/statuses/{sha}","languages_url":"https://api.github.com/repos/hbrunn/OCB/languages","stargazers_url":"https://api.github.com/repos/hbrunn/OCB/stargazers","contributors_url":"https://api.github.com/repos/hbrunn/OCB/contributors","subscribers_url":"https://api.github.com/repos/hbrunn/OCB/subscribers","subscription_url":"https://api.github.com/repos/hbrunn/OCB/subscription","commits_url":"https://api.github.com/repos/hbrunn/OCB/commits{/sha}","git_commits_url":"https://api.github.com/repos/hbrunn/OCB/git/commits{/sha}","comments_url":"https://api.github.com/repos/hbrunn/OCB/comments{/number}","issue_comment_url":"https://api.github.com/repos/hbrunn/OCB/issues/comments{/number}","contents_url":"https://api.github.com/repos/hbrunn/OCB/contents/{+path}","compare_url":"https://api.github.com/repos/hbrunn/OCB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hbrunn/OCB/merges","archive_url":"https://api.github.com/repos/hbrunn/OCB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hbrunn/OCB/downloads","issues_url":"https://api.github.com/repos/hbrunn/OCB/issues{/number}","pulls_url":"https://api.github.com/repos/hbrunn/OCB/pulls{/number}","milestones_url":"https://api.github.com/repos/hbrunn/OCB/milestones{/number}","notifications_url":"https://api.github.com/repos/hbrunn/OCB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hbrunn/OCB/labels{/name}","releases_url":"https://api.github.com/repos/hbrunn/OCB/releases{/id}","deployments_url":"https://api.github.com/repos/hbrunn/OCB/deployments","created_at":"2014-07-15T07:57:27Z","updated_at":"2016-01-26T13:16:55Z","pushed_at":"2016-10-11T16:37:25Z","git_url":"git://github.com/hbrunn/OCB.git","ssh_url":"git@github.com:hbrunn/OCB.git","clone_url":"https://github.com/hbrunn/OCB.git","svn_url":"https://github.com/hbrunn/OCB","homepage":"http://www.odoo-community.org","size":1723455,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"8.0"}},"base":{"label":"odoo:10.0","ref":"10.0","sha":"952a06255d554012d71e0b3c6cf4d08213cb51d3","user":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"repo":{"id":19745004,"name":"odoo","full_name":"odoo/odoo","owner":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=3","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoo/odoo","description":"Odoo (formerly OpenERP). Open Source Apps To Grow Your Business.","fork":false,"url":"https://api.github.com/repos/odoo/odoo","forks_url":"https://api.github.com/repos/odoo/odoo/forks","keys_url":"https://api.github.com/repos/odoo/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoo/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoo/odoo/teams","hooks_url":"https://api.github.com/repos/odoo/odoo/hooks","issue_events_url":"https://api.github.com/repos/odoo/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/odoo/odoo/events","assignees_url":"https://api.github.com/repos/odoo/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/odoo/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/odoo/odoo/tags","blobs_url":"https://api.github.com/repos/odoo/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoo/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoo/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoo/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/odoo/odoo/languages","stargazers_url":"https://api.github.com/repos/odoo/odoo/stargazers","contributors_url":"https://api.github.com/repos/odoo/odoo/contributors","subscribers_url":"https://api.github.com/repos/odoo/odoo/subscribers","subscription_url":"https://api.github.com/repos/odoo/odoo/subscription","commits_url":"https://api.github.com/repos/odoo/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoo/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoo/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoo/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/odoo/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/odoo/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoo/odoo/merges","archive_url":"https://api.github.com/repos/odoo/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoo/odoo/downloads","issues_url":"https://api.github.com/repos/odoo/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/odoo/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/odoo/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/odoo/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoo/odoo/labels{/name}","releases_url":"https://api.github.com/repos/odoo/odoo/releases{/id}","deployments_url":"https://api.github.com/repos/odoo/odoo/deployments","created_at":"2014-05-13T15:38:58Z","updated_at":"2016-10-12T03:25:55Z","pushed_at":"2016-10-12T09:35:29Z","git_url":"git://github.com/odoo/odoo.git","ssh_url":"git@github.com:odoo/odoo.git","clone_url":"https://github.com/odoo/odoo.git","svn_url":"https://github.com/odoo/odoo","homepage":"https://www.odoo.com","size":2021548,"stargazers_count":5157,"watchers_count":5157,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4913,"mirror_url":null,"open_issues_count":3209,"forks":4913,"open_issues":3209,"watchers":5157,"default_branch":"10.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/12954"},"html":{"href":"https://github.com/odoo/odoo/pull/12954"},"issue":{"href":"https://api.github.com/repos/odoo/odoo/issues/12954"},"comments":{"href":"https://api.github.com/repos/odoo/odoo/issues/12954/comments"},"review_comments":{"href":"https://api.github.com/repos/odoo/odoo/pulls/12954/comments"},"review_comment":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odoo/odoo/pulls/12954/commits"},"statuses":{"href":"https://api.github.com/repos/odoo/odoo/statuses/1159546430f7c0b8e65e85d42818f533a729763b"}}}}
{"actor":{"display_login":"rco-odoo"}}