{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/partner-contact/pulls/comments/92770712","pull_request_review_id":13290671,"id":92770712,"diff_hunk":"@@ -0,0 +1,83 @@\n+# -*- coding: utf-8 -*-\n+# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n+\n+from openerp import _, api, exceptions, models\n+\n+\n+class StockMove(models.Model):\n+    _inherit = 'stock.move'\n+\n+    @api.multi\n+    def action_done(self):\n+        if not self.env.context.get('bypass_risk', False):\n+            moves = self.filtered(lambda x: (\n+                x.location_dest_id.usage == 'customer' and\n+                x.partner_id.risk_exception\n+            ))\n+            if moves:\n+                raise exceptions.UserError(\n+                    \"Financial risk exceeded in partners:\\n\"\n+                    \"%s\" % moves.mapped('partner_id.name'))\n+        return super(StockMove, self).action_done()\n+\n+\n+class StockPicking(models.Model):\n+    _inherit = 'stock.picking'\n+\n+    @api.multi\n+    def action_confirm(self):\n+        if not self.env.context.get('bypass_risk', False):","path":"partner_stock_risk/models/stock.py","position":30,"original_position":30,"commit_id":"b2e7ba597c935f50277be4e5c657bc056a17649f","original_commit_id":"b2e7ba597c935f50277be4e5c657bc056a17649f","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":"You can drop `, False` if you want.","created_at":"2016-12-16T08:32:05Z","updated_at":"2016-12-16T08:39:21Z","html_url":"https://github.com/OCA/partner-contact/pull/300#discussion_r92770712","pull_request_url":"https://api.github.com/repos/OCA/partner-contact/pulls/300","_links":{"self":{"href":"https://api.github.com/repos/OCA/partner-contact/pulls/comments/92770712"},"html":{"href":"https://github.com/OCA/partner-contact/pull/300#discussion_r92770712"},"pull_request":{"href":"https://api.github.com/repos/OCA/partner-contact/pulls/300"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/partner-contact/pulls/300","id":81109112,"html_url":"https://github.com/OCA/partner-contact/pull/300","diff_url":"https://github.com/OCA/partner-contact/pull/300.diff","patch_url":"https://github.com/OCA/partner-contact/pull/300.patch","issue_url":"https://api.github.com/repos/OCA/partner-contact/issues/300","number":300,"state":"open","locked":false,"title":"[9.0] [ADD] partner_stock_risk","user":{"login":"carlosdauden","id":7701001,"avatar_url":"https://avatars.githubusercontent.com/u/7701001?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosdauden","html_url":"https://github.com/carlosdauden","followers_url":"https://api.github.com/users/carlosdauden/followers","following_url":"https://api.github.com/users/carlosdauden/following{/other_user}","gists_url":"https://api.github.com/users/carlosdauden/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosdauden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosdauden/subscriptions","organizations_url":"https://api.github.com/users/carlosdauden/orgs","repos_url":"https://api.github.com/users/carlosdauden/repos","events_url":"https://api.github.com/users/carlosdauden/events{/privacy}","received_events_url":"https://api.github.com/users/carlosdauden/received_events","type":"User","site_admin":false},"body":"This module extends #292 \n\nThis PR will be rebased before merge\n\n@Tecnativa\n","created_at":"2016-08-12T12:09:27Z","updated_at":"2016-12-16T08:39:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85e9da986d233374f665e6832c16758727f13f0a","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/OCA/partner-contact/milestones/4","html_url":"https://github.com/OCA/partner-contact/milestone/4","labels_url":"https://api.github.com/repos/OCA/partner-contact/milestones/4/labels","id":1354371,"number":4,"title":"9.0","description":null,"creator":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":30,"state":"open","created_at":"2015-10-14T00:32:28Z","updated_at":"2016-12-16T00:56:08Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/partner-contact/pulls/300/commits","review_comments_url":"https://api.github.com/repos/OCA/partner-contact/pulls/300/comments","review_comment_url":"https://api.github.com/repos/OCA/partner-contact/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/partner-contact/issues/300/comments","statuses_url":"https://api.github.com/repos/OCA/partner-contact/statuses/b2e7ba597c935f50277be4e5c657bc056a17649f","head":{"label":"Tecnativa:9.0-partner_stock_risk","ref":"9.0-partner_stock_risk","sha":"b2e7ba597c935f50277be4e5c657bc056a17649f","user":{"login":"Tecnativa","id":18120193,"avatar_url":"https://avatars.githubusercontent.com/u/18120193?v=3","gravatar_id":"","url":"https://api.github.com/users/Tecnativa","html_url":"https://github.com/Tecnativa","followers_url":"https://api.github.com/users/Tecnativa/followers","following_url":"https://api.github.com/users/Tecnativa/following{/other_user}","gists_url":"https://api.github.com/users/Tecnativa/gists{/gist_id}","starred_url":"https://api.github.com/users/Tecnativa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tecnativa/subscriptions","organizations_url":"https://api.github.com/users/Tecnativa/orgs","repos_url":"https://api.github.com/users/Tecnativa/repos","events_url":"https://api.github.com/users/Tecnativa/events{/privacy}","received_events_url":"https://api.github.com/users/Tecnativa/received_events","type":"Organization","site_admin":false},"repo":{"id":62309164,"name":"partner-contact","full_name":"Tecnativa/partner-contact","owner":{"login":"Tecnativa","id":18120193,"avatar_url":"https://avatars.githubusercontent.com/u/18120193?v=3","gravatar_id":"","url":"https://api.github.com/users/Tecnativa","html_url":"https://github.com/Tecnativa","followers_url":"https://api.github.com/users/Tecnativa/followers","following_url":"https://api.github.com/users/Tecnativa/following{/other_user}","gists_url":"https://api.github.com/users/Tecnativa/gists{/gist_id}","starred_url":"https://api.github.com/users/Tecnativa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tecnativa/subscriptions","organizations_url":"https://api.github.com/users/Tecnativa/orgs","repos_url":"https://api.github.com/users/Tecnativa/repos","events_url":"https://api.github.com/users/Tecnativa/events{/privacy}","received_events_url":"https://api.github.com/users/Tecnativa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tecnativa/partner-contact","description":"Odoo Partner and Contact related addons","fork":true,"url":"https://api.github.com/repos/Tecnativa/partner-contact","forks_url":"https://api.github.com/repos/Tecnativa/partner-contact/forks","keys_url":"https://api.github.com/repos/Tecnativa/partner-contact/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tecnativa/partner-contact/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tecnativa/partner-contact/teams","hooks_url":"https://api.github.com/repos/Tecnativa/partner-contact/hooks","issue_events_url":"https://api.github.com/repos/Tecnativa/partner-contact/issues/events{/number}","events_url":"https://api.github.com/repos/Tecnativa/partner-contact/events","assignees_url":"https://api.github.com/repos/Tecnativa/partner-contact/assignees{/user}","branches_url":"https://api.github.com/repos/Tecnativa/partner-contact/branches{/branch}","tags_url":"https://api.github.com/repos/Tecnativa/partner-contact/tags","blobs_url":"https://api.github.com/repos/Tecnativa/partner-contact/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tecnativa/partner-contact/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tecnativa/partner-contact/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tecnativa/partner-contact/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tecnativa/partner-contact/statuses/{sha}","languages_url":"https://api.github.com/repos/Tecnativa/partner-contact/languages","stargazers_url":"https://api.github.com/repos/Tecnativa/partner-contact/stargazers","contributors_url":"https://api.github.com/repos/Tecnativa/partner-contact/contributors","subscribers_url":"https://api.github.com/repos/Tecnativa/partner-contact/subscribers","subscription_url":"https://api.github.com/repos/Tecnativa/partner-contact/subscription","commits_url":"https://api.github.com/repos/Tecnativa/partner-contact/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tecnativa/partner-contact/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tecnativa/partner-contact/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tecnativa/partner-contact/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tecnativa/partner-contact/contents/{+path}","compare_url":"https://api.github.com/repos/Tecnativa/partner-contact/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tecnativa/partner-contact/merges","archive_url":"https://api.github.com/repos/Tecnativa/partner-contact/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tecnativa/partner-contact/downloads","issues_url":"https://api.github.com/repos/Tecnativa/partner-contact/issues{/number}","pulls_url":"https://api.github.com/repos/Tecnativa/partner-contact/pulls{/number}","milestones_url":"https://api.github.com/repos/Tecnativa/partner-contact/milestones{/number}","notifications_url":"https://api.github.com/repos/Tecnativa/partner-contact/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tecnativa/partner-contact/labels{/name}","releases_url":"https://api.github.com/repos/Tecnativa/partner-contact/releases{/id}","deployments_url":"https://api.github.com/repos/Tecnativa/partner-contact/deployments","created_at":"2016-06-30T12:33:35Z","updated_at":"2016-06-30T12:33:37Z","pushed_at":"2016-12-16T04:36:04Z","git_url":"git://github.com/Tecnativa/partner-contact.git","ssh_url":"git@github.com:Tecnativa/partner-contact.git","clone_url":"https://github.com/Tecnativa/partner-contact.git","svn_url":"https://github.com/Tecnativa/partner-contact","homepage":"","size":3751,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"9.0"}},"base":{"label":"OCA:9.0","ref":"9.0","sha":"14bc1060ad4cefde8479406b5814ff344ec471c4","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":20922147,"name":"partner-contact","full_name":"OCA/partner-contact","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/partner-contact","description":"Odoo Partner and Contact related addons","fork":false,"url":"https://api.github.com/repos/OCA/partner-contact","forks_url":"https://api.github.com/repos/OCA/partner-contact/forks","keys_url":"https://api.github.com/repos/OCA/partner-contact/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/partner-contact/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/partner-contact/teams","hooks_url":"https://api.github.com/repos/OCA/partner-contact/hooks","issue_events_url":"https://api.github.com/repos/OCA/partner-contact/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/partner-contact/events","assignees_url":"https://api.github.com/repos/OCA/partner-contact/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/partner-contact/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/partner-contact/tags","blobs_url":"https://api.github.com/repos/OCA/partner-contact/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/partner-contact/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/partner-contact/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/partner-contact/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/partner-contact/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/partner-contact/languages","stargazers_url":"https://api.github.com/repos/OCA/partner-contact/stargazers","contributors_url":"https://api.github.com/repos/OCA/partner-contact/contributors","subscribers_url":"https://api.github.com/repos/OCA/partner-contact/subscribers","subscription_url":"https://api.github.com/repos/OCA/partner-contact/subscription","commits_url":"https://api.github.com/repos/OCA/partner-contact/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/partner-contact/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/partner-contact/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/partner-contact/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/partner-contact/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/partner-contact/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/partner-contact/merges","archive_url":"https://api.github.com/repos/OCA/partner-contact/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/partner-contact/downloads","issues_url":"https://api.github.com/repos/OCA/partner-contact/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/partner-contact/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/partner-contact/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/partner-contact/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/partner-contact/labels{/name}","releases_url":"https://api.github.com/repos/OCA/partner-contact/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/partner-contact/deployments","created_at":"2014-06-17T12:19:26Z","updated_at":"2016-11-23T15:11:40Z","pushed_at":"2016-12-16T04:36:04Z","git_url":"git://github.com/OCA/partner-contact.git","ssh_url":"git@github.com:OCA/partner-contact.git","clone_url":"https://github.com/OCA/partner-contact.git","svn_url":"https://github.com/OCA/partner-contact","homepage":"","size":3940,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":188,"mirror_url":null,"open_issues_count":63,"forks":188,"open_issues":63,"watchers":43,"default_branch":"10.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/partner-contact/pulls/300"},"html":{"href":"https://github.com/OCA/partner-contact/pull/300"},"issue":{"href":"https://api.github.com/repos/OCA/partner-contact/issues/300"},"comments":{"href":"https://api.github.com/repos/OCA/partner-contact/issues/300/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/partner-contact/pulls/300/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/partner-contact/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/partner-contact/pulls/300/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/partner-contact/statuses/b2e7ba597c935f50277be4e5c657bc056a17649f"}}}}
{"actor":{"display_login":"Yajo"}}