{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/crm/pulls/comments/25856976","id":25856976,"diff_hunk":"@@ -28,10 +28,17 @@ class CrmLeadLost(models.TransientModel):\n     _name = 'crm.lead.lost'\n     _description = __doc__\n \n+    def _default_reason(self):\n+        active_id = self._context.get('active_id', [])\n+        if active_id:\n+            lead = self.env['crm.lead'].browse(active_id)","path":"crm_lead_lost_reason/wizard/lost_reason.py","position":7,"original_position":7,"commit_id":"2a5a8c7ae1405a0bde0b2230f5d9a7401dacbdca","original_commit_id":"2a5a8c7ae1405a0bde0b2230f5d9a7401dacbdca","user":{"login":"gurneyalex","id":2032807,"avatar_url":"https://avatars.githubusercontent.com/u/2032807?v=3","gravatar_id":"","url":"https://api.github.com/users/gurneyalex","html_url":"https://github.com/gurneyalex","followers_url":"https://api.github.com/users/gurneyalex/followers","following_url":"https://api.github.com/users/gurneyalex/following{/other_user}","gists_url":"https://api.github.com/users/gurneyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/gurneyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurneyalex/subscriptions","organizations_url":"https://api.github.com/users/gurneyalex/orgs","repos_url":"https://api.github.com/users/gurneyalex/repos","events_url":"https://api.github.com/users/gurneyalex/events{/privacy}","received_events_url":"https://api.github.com/users/gurneyalex/received_events","type":"User","site_admin":false},"body":"not sure about the rules regarding active_id vs active_ids in the context","created_at":"2015-03-05T11:31:51Z","updated_at":"2015-03-05T11:31:51Z","html_url":"https://github.com/OCA/crm/pull/21#discussion_r25856976","pull_request_url":"https://api.github.com/repos/OCA/crm/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/OCA/crm/pulls/comments/25856976"},"html":{"href":"https://github.com/OCA/crm/pull/21#discussion_r25856976"},"pull_request":{"href":"https://api.github.com/repos/OCA/crm/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/crm/pulls/21","id":30546218,"html_url":"https://github.com/OCA/crm/pull/21","diff_url":"https://github.com/OCA/crm/pull/21.diff","patch_url":"https://github.com/OCA/crm/pull/21.patch","issue_url":"https://api.github.com/repos/OCA/crm/issues/21","number":21,"state":"open","locked":false,"title":"[ADD] fill lost reason in wizard if exists","user":{"login":"rdeheele","id":7079268,"avatar_url":"https://avatars.githubusercontent.com/u/7079268?v=3","gravatar_id":"","url":"https://api.github.com/users/rdeheele","html_url":"https://github.com/rdeheele","followers_url":"https://api.github.com/users/rdeheele/followers","following_url":"https://api.github.com/users/rdeheele/following{/other_user}","gists_url":"https://api.github.com/users/rdeheele/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeheele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeheele/subscriptions","organizations_url":"https://api.github.com/users/rdeheele/orgs","repos_url":"https://api.github.com/users/rdeheele/repos","events_url":"https://api.github.com/users/rdeheele/events{/privacy}","received_events_url":"https://api.github.com/users/rdeheele/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-05T10:39:54Z","updated_at":"2015-03-05T11:31:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94a2d0a4e42e04fb284308a18db003bd0d1e4058","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/crm/pulls/21/commits","review_comments_url":"https://api.github.com/repos/OCA/crm/pulls/21/comments","review_comment_url":"https://api.github.com/repos/OCA/crm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/crm/issues/21/comments","statuses_url":"https://api.github.com/repos/OCA/crm/statuses/2a5a8c7ae1405a0bde0b2230f5d9a7401dacbdca","head":{"label":"rdeheele:default_get_crm_lead_lost_reaso","ref":"default_get_crm_lead_lost_reaso","sha":"2a5a8c7ae1405a0bde0b2230f5d9a7401dacbdca","user":{"login":"rdeheele","id":7079268,"avatar_url":"https://avatars.githubusercontent.com/u/7079268?v=3","gravatar_id":"","url":"https://api.github.com/users/rdeheele","html_url":"https://github.com/rdeheele","followers_url":"https://api.github.com/users/rdeheele/followers","following_url":"https://api.github.com/users/rdeheele/following{/other_user}","gists_url":"https://api.github.com/users/rdeheele/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeheele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeheele/subscriptions","organizations_url":"https://api.github.com/users/rdeheele/orgs","repos_url":"https://api.github.com/users/rdeheele/repos","events_url":"https://api.github.com/users/rdeheele/events{/privacy}","received_events_url":"https://api.github.com/users/rdeheele/received_events","type":"User","site_admin":false},"repo":{"id":23458368,"name":"crm","full_name":"rdeheele/crm","owner":{"login":"rdeheele","id":7079268,"avatar_url":"https://avatars.githubusercontent.com/u/7079268?v=3","gravatar_id":"","url":"https://api.github.com/users/rdeheele","html_url":"https://github.com/rdeheele","followers_url":"https://api.github.com/users/rdeheele/followers","following_url":"https://api.github.com/users/rdeheele/following{/other_user}","gists_url":"https://api.github.com/users/rdeheele/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeheele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeheele/subscriptions","organizations_url":"https://api.github.com/users/rdeheele/orgs","repos_url":"https://api.github.com/users/rdeheele/repos","events_url":"https://api.github.com/users/rdeheele/events{/privacy}","received_events_url":"https://api.github.com/users/rdeheele/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rdeheele/crm","description":"","fork":true,"url":"https://api.github.com/repos/rdeheele/crm","forks_url":"https://api.github.com/repos/rdeheele/crm/forks","keys_url":"https://api.github.com/repos/rdeheele/crm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdeheele/crm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdeheele/crm/teams","hooks_url":"https://api.github.com/repos/rdeheele/crm/hooks","issue_events_url":"https://api.github.com/repos/rdeheele/crm/issues/events{/number}","events_url":"https://api.github.com/repos/rdeheele/crm/events","assignees_url":"https://api.github.com/repos/rdeheele/crm/assignees{/user}","branches_url":"https://api.github.com/repos/rdeheele/crm/branches{/branch}","tags_url":"https://api.github.com/repos/rdeheele/crm/tags","blobs_url":"https://api.github.com/repos/rdeheele/crm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdeheele/crm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdeheele/crm/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdeheele/crm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdeheele/crm/statuses/{sha}","languages_url":"https://api.github.com/repos/rdeheele/crm/languages","stargazers_url":"https://api.github.com/repos/rdeheele/crm/stargazers","contributors_url":"https://api.github.com/repos/rdeheele/crm/contributors","subscribers_url":"https://api.github.com/repos/rdeheele/crm/subscribers","subscription_url":"https://api.github.com/repos/rdeheele/crm/subscription","commits_url":"https://api.github.com/repos/rdeheele/crm/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdeheele/crm/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdeheele/crm/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdeheele/crm/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdeheele/crm/contents/{+path}","compare_url":"https://api.github.com/repos/rdeheele/crm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdeheele/crm/merges","archive_url":"https://api.github.com/repos/rdeheele/crm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdeheele/crm/downloads","issues_url":"https://api.github.com/repos/rdeheele/crm/issues{/number}","pulls_url":"https://api.github.com/repos/rdeheele/crm/pulls{/number}","milestones_url":"https://api.github.com/repos/rdeheele/crm/milestones{/number}","notifications_url":"https://api.github.com/repos/rdeheele/crm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdeheele/crm/labels{/name}","releases_url":"https://api.github.com/repos/rdeheele/crm/releases{/id}","created_at":"2014-08-29T08:52:52Z","updated_at":"2014-07-14T08:18:07Z","pushed_at":"2015-03-05T11:16:21Z","git_url":"git://github.com/rdeheele/crm.git","ssh_url":"git@github.com:rdeheele/crm.git","clone_url":"https://github.com/rdeheele/crm.git","svn_url":"https://github.com/rdeheele/crm","homepage":null,"size":374,"stargazers_count":0,"watchers_count":0,"language":null,"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":"OCA:8.0","ref":"8.0","sha":"df14fb0ae8c692f04063896127bee64810f2ca4d","user":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"repo":{"id":20882583,"name":"crm","full_name":"OCA/crm","owner":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OCA/crm","description":"","fork":false,"url":"https://api.github.com/repos/OCA/crm","forks_url":"https://api.github.com/repos/OCA/crm/forks","keys_url":"https://api.github.com/repos/OCA/crm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/crm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/crm/teams","hooks_url":"https://api.github.com/repos/OCA/crm/hooks","issue_events_url":"https://api.github.com/repos/OCA/crm/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/crm/events","assignees_url":"https://api.github.com/repos/OCA/crm/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/crm/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/crm/tags","blobs_url":"https://api.github.com/repos/OCA/crm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/crm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/crm/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/crm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/crm/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/crm/languages","stargazers_url":"https://api.github.com/repos/OCA/crm/stargazers","contributors_url":"https://api.github.com/repos/OCA/crm/contributors","subscribers_url":"https://api.github.com/repos/OCA/crm/subscribers","subscription_url":"https://api.github.com/repos/OCA/crm/subscription","commits_url":"https://api.github.com/repos/OCA/crm/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/crm/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/crm/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/crm/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/crm/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/crm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/crm/merges","archive_url":"https://api.github.com/repos/OCA/crm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/crm/downloads","issues_url":"https://api.github.com/repos/OCA/crm/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/crm/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/crm/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/crm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/crm/labels{/name}","releases_url":"https://api.github.com/repos/OCA/crm/releases{/id}","created_at":"2014-06-16T11:33:18Z","updated_at":"2015-03-02T16:24:28Z","pushed_at":"2015-03-03T16:23:01Z","git_url":"git://github.com/OCA/crm.git","ssh_url":"git@github.com:OCA/crm.git","clone_url":"https://github.com/OCA/crm.git","svn_url":"https://github.com/OCA/crm","homepage":null,"size":743,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":1,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/crm/pulls/21"},"html":{"href":"https://github.com/OCA/crm/pull/21"},"issue":{"href":"https://api.github.com/repos/OCA/crm/issues/21"},"comments":{"href":"https://api.github.com/repos/OCA/crm/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/crm/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/crm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/crm/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/crm/statuses/2a5a8c7ae1405a0bde0b2230f5d9a7401dacbdca"}}}}