{"action":"created","comment":{"url":"https://api.github.com/repos/odoo/odoo/pulls/comments/41483493","id":41483493,"diff_hunk":"@@ -730,28 +730,35 @@ def convert_opportunity(self, cr, uid, ids, partner_id, user_ids=False, section_\n \n         return True\n \n+    @api.one","path":"addons/crm/crm_lead.py","position":22,"original_position":22,"commit_id":"f1d2952c87ffa0a09b2d20f7300d29802f796338","original_commit_id":"f1d2952c87ffa0a09b2d20f7300d29802f796338","user":{"login":"nim-odoo","id":11041725,"avatar_url":"https://avatars.githubusercontent.com/u/11041725?v=3","gravatar_id":"","url":"https://api.github.com/users/nim-odoo","html_url":"https://github.com/nim-odoo","followers_url":"https://api.github.com/users/nim-odoo/followers","following_url":"https://api.github.com/users/nim-odoo/following{/other_user}","gists_url":"https://api.github.com/users/nim-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/nim-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nim-odoo/subscriptions","organizations_url":"https://api.github.com/users/nim-odoo/orgs","repos_url":"https://api.github.com/users/nim-odoo/repos","events_url":"https://api.github.com/users/nim-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/nim-odoo/received_events","type":"User","site_admin":false},"body":"@api.one is indeed deprecated in v9.0. Moreover, the method create takes a dict as parameter, not a list of dicts: https://www.odoo.com/documentation/8.0/reference/orm.html#openerp.models.Model.create Since @api.one wraps the result in a list, that's not a good idea at all.\r\n\r\nFinally, we avoid mixing both APIs in the same file. I agree that @api is used in order to be able to mix APIs, but the original idea is to be able to call a method written in new api from a method written in old api.","created_at":"2015-10-08T07:33:33Z","updated_at":"2015-10-08T07:33:33Z","html_url":"https://github.com/odoo/odoo/pull/8899#discussion_r41483493","pull_request_url":"https://api.github.com/repos/odoo/odoo/pulls/8899","_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments/41483493"},"html":{"href":"https://github.com/odoo/odoo/pull/8899#discussion_r41483493"},"pull_request":{"href":"https://api.github.com/repos/odoo/odoo/pulls/8899"}}},"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/8899","id":46803676,"html_url":"https://github.com/odoo/odoo/pull/8899","diff_url":"https://github.com/odoo/odoo/pull/8899.diff","patch_url":"https://github.com/odoo/odoo/pull/8899.patch","issue_url":"https://api.github.com/repos/odoo/odoo/issues/8899","number":8899,"state":"open","locked":false,"title":"Hook for generating values for conversion between crm.lead and res.partner","user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"body":"This essentially does the same it was doing, but adding a hook for crm modules that will then be easily able to add fields that can be converted to their `res.partner` counterpart.\r\n\r\nCC @rafaelbn @pedrobaeza.","created_at":"2015-10-05T16:36:50Z","updated_at":"2015-10-08T07:33:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1cdb36a04963e898c9ff5a88c1f6980eebc9b65","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoo/odoo/pulls/8899/commits","review_comments_url":"https://api.github.com/repos/odoo/odoo/pulls/8899/comments","review_comment_url":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/8899/comments","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/f1d2952c87ffa0a09b2d20f7300d29802f796338","head":{"label":"Yajo:crm-lead-create-contact-hook","ref":"crm-lead-create-contact-hook","sha":"f1d2952c87ffa0a09b2d20f7300d29802f796338","user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"repo":{"id":43002336,"name":"odoo","full_name":"Yajo/odoo","owner":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Yajo/odoo","description":"Odoo (formerly OpenERP). Open Source Apps To Grow Your Business.","fork":true,"url":"https://api.github.com/repos/Yajo/odoo","forks_url":"https://api.github.com/repos/Yajo/odoo/forks","keys_url":"https://api.github.com/repos/Yajo/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yajo/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yajo/odoo/teams","hooks_url":"https://api.github.com/repos/Yajo/odoo/hooks","issue_events_url":"https://api.github.com/repos/Yajo/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/Yajo/odoo/events","assignees_url":"https://api.github.com/repos/Yajo/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/Yajo/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/Yajo/odoo/tags","blobs_url":"https://api.github.com/repos/Yajo/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yajo/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yajo/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yajo/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yajo/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/Yajo/odoo/languages","stargazers_url":"https://api.github.com/repos/Yajo/odoo/stargazers","contributors_url":"https://api.github.com/repos/Yajo/odoo/contributors","subscribers_url":"https://api.github.com/repos/Yajo/odoo/subscribers","subscription_url":"https://api.github.com/repos/Yajo/odoo/subscription","commits_url":"https://api.github.com/repos/Yajo/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yajo/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yajo/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yajo/odoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yajo/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/Yajo/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yajo/odoo/merges","archive_url":"https://api.github.com/repos/Yajo/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yajo/odoo/downloads","issues_url":"https://api.github.com/repos/Yajo/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/Yajo/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/Yajo/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/Yajo/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yajo/odoo/labels{/name}","releases_url":"https://api.github.com/repos/Yajo/odoo/releases{/id}","created_at":"2015-09-23T13:23:34Z","updated_at":"2015-09-23T13:26:24Z","pushed_at":"2015-10-05T16:34:46Z","git_url":"git://github.com/Yajo/odoo.git","ssh_url":"git@github.com:Yajo/odoo.git","clone_url":"https://github.com/Yajo/odoo.git","svn_url":"https://github.com/Yajo/odoo","homepage":"https://www.odoo.com","size":927926,"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:8.0","ref":"8.0","sha":"25634df8f2809313e2fd1620be59908486aa8b3d","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-10-08T06:52:02Z","pushed_at":"2015-10-08T07:31:08Z","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":1553599,"stargazers_count":3205,"watchers_count":3205,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2802,"mirror_url":null,"open_issues_count":2613,"forks":2802,"open_issues":2613,"watchers":3205,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/8899"},"html":{"href":"https://github.com/odoo/odoo/pull/8899"},"issue":{"href":"https://api.github.com/repos/odoo/odoo/issues/8899"},"comments":{"href":"https://api.github.com/repos/odoo/odoo/issues/8899/comments"},"review_comments":{"href":"https://api.github.com/repos/odoo/odoo/pulls/8899/comments"},"review_comment":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odoo/odoo/pulls/8899/commits"},"statuses":{"href":"https://api.github.com/repos/odoo/odoo/statuses/f1d2952c87ffa0a09b2d20f7300d29802f796338"}}}}