{"action":"created","comment":{"url":"https://api.github.com/repos/odoo/odoo/pulls/comments/34796583","id":34796583,"diff_hunk":"@@ -913,12 +943,12 @@ def push_result(leaf):\n             # -------------------------------------------------\n \n             # Applying recursivity on field(one2many)\n-            elif column._type == 'one2many' and operator == 'child_of':\n+            elif column._type == 'one2many' and operator in parent_child_method.keys():","path":"openerp/osv/expression.py","position":63,"original_position":63,"commit_id":"f6fabfd506b112ca136375f1d52c80673ad4990e","original_commit_id":"f6fabfd506b112ca136375f1d52c80673ad4990e","user":{"login":"odony","id":2039870,"avatar_url":"https://avatars.githubusercontent.com/u/2039870?v=3","gravatar_id":"","url":"https://api.github.com/users/odony","html_url":"https://github.com/odony","followers_url":"https://api.github.com/users/odony/followers","following_url":"https://api.github.com/users/odony/following{/other_user}","gists_url":"https://api.github.com/users/odony/gists{/gist_id}","starred_url":"https://api.github.com/users/odony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odony/subscriptions","organizations_url":"https://api.github.com/users/odony/orgs","repos_url":"https://api.github.com/users/odony/repos","events_url":"https://api.github.com/users/odony/events{/privacy}","received_events_url":"https://api.github.com/users/odony/received_events","type":"User","site_admin":false},"body":"It would be nice to extract the list of operators in a constant, e.g.:\r\n```python\r\nHIERARCHICY_OPERATORS = set(('child_of', 'parent_of'))\r\n```\r\nor\r\n```python\r\nHIERARCHY_FUNCS = {'child_of': child_of_domain, 'parent_of': parent_of_domain}\r\nHIERARCHICY_OPERATORS = set(HIERARCHY_FUNCS.keys())\r\n```\r\n\r\n","created_at":"2015-07-16T14:59:02Z","updated_at":"2015-07-16T14:59:02Z","html_url":"https://github.com/odoo/odoo/pull/7641#discussion_r34796583","pull_request_url":"https://api.github.com/repos/odoo/odoo/pulls/7641","_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments/34796583"},"html":{"href":"https://github.com/odoo/odoo/pull/7641#discussion_r34796583"},"pull_request":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7641"}}},"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/7641","id":40121016,"html_url":"https://github.com/odoo/odoo/pull/7641","diff_url":"https://github.com/odoo/odoo/pull/7641.diff","patch_url":"https://github.com/odoo/odoo/pull/7641.patch","issue_url":"https://api.github.com/repos/odoo/odoo/issues/7641","number":7641,"state":"open","locked":false,"title":"[ADD] Add parent_of operator","user":{"login":"adrienpeiffer","id":8035793,"avatar_url":"https://avatars.githubusercontent.com/u/8035793?v=3","gravatar_id":"","url":"https://api.github.com/users/adrienpeiffer","html_url":"https://github.com/adrienpeiffer","followers_url":"https://api.github.com/users/adrienpeiffer/followers","following_url":"https://api.github.com/users/adrienpeiffer/following{/other_user}","gists_url":"https://api.github.com/users/adrienpeiffer/gists{/gist_id}","starred_url":"https://api.github.com/users/adrienpeiffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrienpeiffer/subscriptions","organizations_url":"https://api.github.com/users/adrienpeiffer/orgs","repos_url":"https://api.github.com/users/adrienpeiffer/repos","events_url":"https://api.github.com/users/adrienpeiffer/events{/privacy}","received_events_url":"https://api.github.com/users/adrienpeiffer/received_events","type":"User","site_admin":false},"body":"Add parent_of operator\r\n\r\nAn idea from https://github.com/alhashash/odoo/tree/master-new_operator_parent_of","created_at":"2015-07-16T11:53:06Z","updated_at":"2015-07-16T14:59:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5b8bb49ad5894c29f1dcedcabb8b41950d51752","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoo/odoo/pulls/7641/commits","review_comments_url":"https://api.github.com/repos/odoo/odoo/pulls/7641/comments","review_comment_url":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/7641/comments","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/f6fabfd506b112ca136375f1d52c80673ad4990e","head":{"label":"acsone:8.0-add-parentof-operator-ape","ref":"8.0-add-parentof-operator-ape","sha":"f6fabfd506b112ca136375f1d52c80673ad4990e","user":{"login":"acsone","id":7601056,"avatar_url":"https://avatars.githubusercontent.com/u/7601056?v=3","gravatar_id":"","url":"https://api.github.com/users/acsone","html_url":"https://github.com/acsone","followers_url":"https://api.github.com/users/acsone/followers","following_url":"https://api.github.com/users/acsone/following{/other_user}","gists_url":"https://api.github.com/users/acsone/gists{/gist_id}","starred_url":"https://api.github.com/users/acsone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acsone/subscriptions","organizations_url":"https://api.github.com/users/acsone/orgs","repos_url":"https://api.github.com/users/acsone/repos","events_url":"https://api.github.com/users/acsone/events{/privacy}","received_events_url":"https://api.github.com/users/acsone/received_events","type":"Organization","site_admin":false},"repo":{"id":20557009,"name":"odoo","full_name":"acsone/odoo","owner":{"login":"acsone","id":7601056,"avatar_url":"https://avatars.githubusercontent.com/u/7601056?v=3","gravatar_id":"","url":"https://api.github.com/users/acsone","html_url":"https://github.com/acsone","followers_url":"https://api.github.com/users/acsone/followers","following_url":"https://api.github.com/users/acsone/following{/other_user}","gists_url":"https://api.github.com/users/acsone/gists{/gist_id}","starred_url":"https://api.github.com/users/acsone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acsone/subscriptions","organizations_url":"https://api.github.com/users/acsone/orgs","repos_url":"https://api.github.com/users/acsone/repos","events_url":"https://api.github.com/users/acsone/events{/privacy}","received_events_url":"https://api.github.com/users/acsone/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acsone/odoo","description":"Odoo (formerly OpenERP). Open Source Business Apps.","fork":true,"url":"https://api.github.com/repos/acsone/odoo","forks_url":"https://api.github.com/repos/acsone/odoo/forks","keys_url":"https://api.github.com/repos/acsone/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acsone/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acsone/odoo/teams","hooks_url":"https://api.github.com/repos/acsone/odoo/hooks","issue_events_url":"https://api.github.com/repos/acsone/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/acsone/odoo/events","assignees_url":"https://api.github.com/repos/acsone/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/acsone/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/acsone/odoo/tags","blobs_url":"https://api.github.com/repos/acsone/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acsone/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acsone/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/acsone/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acsone/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/acsone/odoo/languages","stargazers_url":"https://api.github.com/repos/acsone/odoo/stargazers","contributors_url":"https://api.github.com/repos/acsone/odoo/contributors","subscribers_url":"https://api.github.com/repos/acsone/odoo/subscribers","subscription_url":"https://api.github.com/repos/acsone/odoo/subscription","commits_url":"https://api.github.com/repos/acsone/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/acsone/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/acsone/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/acsone/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/acsone/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/acsone/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acsone/odoo/merges","archive_url":"https://api.github.com/repos/acsone/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acsone/odoo/downloads","issues_url":"https://api.github.com/repos/acsone/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/acsone/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/acsone/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/acsone/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acsone/odoo/labels{/name}","releases_url":"https://api.github.com/repos/acsone/odoo/releases{/id}","created_at":"2014-06-06T08:44:17Z","updated_at":"2015-04-29T07:03:00Z","pushed_at":"2015-07-16T11:44:45Z","git_url":"git://github.com/acsone/odoo.git","ssh_url":"git@github.com:acsone/odoo.git","clone_url":"https://github.com/acsone/odoo.git","svn_url":"https://github.com/acsone/odoo","homepage":"https://www.odoo.com","size":758305,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"8.0"}},"base":{"label":"odoo:8.0","ref":"8.0","sha":"e61970241f2ffab2ed0f8247c57f80195bb18c56","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}","created_at":"2014-05-13T15:38:58Z","updated_at":"2015-07-16T12:17:27Z","pushed_at":"2015-07-16T14:58:58Z","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":1333506,"stargazers_count":2787,"watchers_count":2787,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2358,"mirror_url":null,"open_issues_count":2416,"forks":2358,"open_issues":2416,"watchers":2787,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7641"},"html":{"href":"https://github.com/odoo/odoo/pull/7641"},"issue":{"href":"https://api.github.com/repos/odoo/odoo/issues/7641"},"comments":{"href":"https://api.github.com/repos/odoo/odoo/issues/7641/comments"},"review_comments":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7641/comments"},"review_comment":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odoo/odoo/pulls/7641/commits"},"statuses":{"href":"https://api.github.com/repos/odoo/odoo/statuses/f6fabfd506b112ca136375f1d52c80673ad4990e"}}}}