{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/comments/52576216","id":52576216,"diff_hunk":"@@ -59,11 +44,34 @@ class AccountInvoice(models.Model):\n \n     picking_ids = fields.One2many(\n         comodel_name='stock.picking', inverse_name='invoice_id',\n-        string='Related Pickings', readonly=True,\n-        copy=False,\n+        string='Related Pickings', readonly=True, copy=False,\n         help=\"Related pickings \"\n              \"(only when the invoice has been generated from the picking).\")\n \n+    @api.multi\n+    def unlink(self):\n+        if any([x and x != 'cancel' for x in\n+                self.mapped('picking_ids.state')]):\n+            raise exceptions.Warning(","path":"stock_picking_invoice_link/models/stock.py","position":63,"original_position":44,"commit_id":"a395df334b668583997d2fa7ef3ec793af925e3c","original_commit_id":"14e72f578339da781c79f25ee4fceecf4844183f","user":{"login":"oihane","id":2323616,"avatar_url":"https://avatars.githubusercontent.com/u/2323616?v=3","gravatar_id":"","url":"https://api.github.com/users/oihane","html_url":"https://github.com/oihane","followers_url":"https://api.github.com/users/oihane/followers","following_url":"https://api.github.com/users/oihane/following{/other_user}","gists_url":"https://api.github.com/users/oihane/gists{/gist_id}","starred_url":"https://api.github.com/users/oihane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oihane/subscriptions","organizations_url":"https://api.github.com/users/oihane/orgs","repos_url":"https://api.github.com/users/oihane/repos","events_url":"https://api.github.com/users/oihane/events{/privacy}","received_events_url":"https://api.github.com/users/oihane/received_events","type":"User","site_admin":false},"body":"Now it is :wink: ","created_at":"2016-02-11T09:10:28Z","updated_at":"2016-02-11T09:10:28Z","html_url":"https://github.com/OCA/stock-logistics-workflow/pull/202#discussion_r52576216","pull_request_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202","_links":{"self":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/comments/52576216"},"html":{"href":"https://github.com/OCA/stock-logistics-workflow/pull/202#discussion_r52576216"},"pull_request":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202","id":58871662,"html_url":"https://github.com/OCA/stock-logistics-workflow/pull/202","diff_url":"https://github.com/OCA/stock-logistics-workflow/pull/202.diff","patch_url":"https://github.com/OCA/stock-logistics-workflow/pull/202.patch","issue_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/issues/202","number":202,"state":"open","locked":false,"title":"[IMP] stock_picking_invoice_link: added new functionality","user":{"login":"oihane","id":2323616,"avatar_url":"https://avatars.githubusercontent.com/u/2323616?v=3","gravatar_id":"","url":"https://api.github.com/users/oihane","html_url":"https://github.com/oihane","followers_url":"https://api.github.com/users/oihane/followers","following_url":"https://api.github.com/users/oihane/following{/other_user}","gists_url":"https://api.github.com/users/oihane/gists{/gist_id}","starred_url":"https://api.github.com/users/oihane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oihane/subscriptions","organizations_url":"https://api.github.com/users/oihane/orgs","repos_url":"https://api.github.com/users/oihane/repos","events_url":"https://api.github.com/users/oihane/events{/privacy}","received_events_url":"https://api.github.com/users/oihane/received_events","type":"User","site_admin":false},"body":"* When an invoice is cancelled its pickings go back to \"to2invoiced\" state\r\n* If a cancelled invoice goes back again to draft, its pickings are marked as invoiced to avoid invoicing twice\r\n* An invoice with not cancelled pickings can't be erased\r\n\r\n\r\nFunctionalities extracted from **[account_invoice_line_stock_move_info](https://github.com/odoomrp/odoomrp-utils/tree/8.0/account_invoice_line_stock_move_info)** module","created_at":"2016-02-10T10:29:02Z","updated_at":"2016-02-11T09:10:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"896702736d88c8fc8dce65a1f75536e832fc4176","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202/commits","review_comments_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202/comments","review_comment_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/issues/202/comments","statuses_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/statuses/a395df334b668583997d2fa7ef3ec793af925e3c","head":{"label":"oihane:8.0-invoice_link","ref":"8.0-invoice_link","sha":"a395df334b668583997d2fa7ef3ec793af925e3c","user":{"login":"oihane","id":2323616,"avatar_url":"https://avatars.githubusercontent.com/u/2323616?v=3","gravatar_id":"","url":"https://api.github.com/users/oihane","html_url":"https://github.com/oihane","followers_url":"https://api.github.com/users/oihane/followers","following_url":"https://api.github.com/users/oihane/following{/other_user}","gists_url":"https://api.github.com/users/oihane/gists{/gist_id}","starred_url":"https://api.github.com/users/oihane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oihane/subscriptions","organizations_url":"https://api.github.com/users/oihane/orgs","repos_url":"https://api.github.com/users/oihane/repos","events_url":"https://api.github.com/users/oihane/events{/privacy}","received_events_url":"https://api.github.com/users/oihane/received_events","type":"User","site_admin":false},"repo":{"id":30299890,"name":"stock-logistics-workflow","full_name":"oihane/stock-logistics-workflow","owner":{"login":"oihane","id":2323616,"avatar_url":"https://avatars.githubusercontent.com/u/2323616?v=3","gravatar_id":"","url":"https://api.github.com/users/oihane","html_url":"https://github.com/oihane","followers_url":"https://api.github.com/users/oihane/followers","following_url":"https://api.github.com/users/oihane/following{/other_user}","gists_url":"https://api.github.com/users/oihane/gists{/gist_id}","starred_url":"https://api.github.com/users/oihane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oihane/subscriptions","organizations_url":"https://api.github.com/users/oihane/orgs","repos_url":"https://api.github.com/users/oihane/repos","events_url":"https://api.github.com/users/oihane/events{/privacy}","received_events_url":"https://api.github.com/users/oihane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oihane/stock-logistics-workflow","description":"","fork":true,"url":"https://api.github.com/repos/oihane/stock-logistics-workflow","forks_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/forks","keys_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/teams","hooks_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/hooks","issue_events_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/events","assignees_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/tags","blobs_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/languages","stargazers_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/stargazers","contributors_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/contributors","subscribers_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/subscribers","subscription_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/subscription","commits_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/merges","archive_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/downloads","issues_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/labels{/name}","releases_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/releases{/id}","deployments_url":"https://api.github.com/repos/oihane/stock-logistics-workflow/deployments","created_at":"2015-02-04T13:25:24Z","updated_at":"2015-02-04T13:25:25Z","pushed_at":"2016-02-11T09:09:25Z","git_url":"git://github.com/oihane/stock-logistics-workflow.git","ssh_url":"git@github.com:oihane/stock-logistics-workflow.git","clone_url":"https://github.com/oihane/stock-logistics-workflow.git","svn_url":"https://github.com/oihane/stock-logistics-workflow","homepage":null,"size":1165,"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":"OCA:8.0","ref":"8.0","sha":"283aefcdfe39589107474760dae98bcb6f47bd47","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":20891076,"name":"stock-logistics-workflow","full_name":"OCA/stock-logistics-workflow","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/stock-logistics-workflow","description":"Odoo Stock, Workflow and Organization","fork":false,"url":"https://api.github.com/repos/OCA/stock-logistics-workflow","forks_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/forks","keys_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/teams","hooks_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/hooks","issue_events_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/events","assignees_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/tags","blobs_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/languages","stargazers_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/stargazers","contributors_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/contributors","subscribers_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/subscribers","subscription_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/subscription","commits_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/merges","archive_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/downloads","issues_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/labels{/name}","releases_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/stock-logistics-workflow/deployments","created_at":"2014-06-16T16:00:29Z","updated_at":"2016-01-27T14:35:56Z","pushed_at":"2016-02-11T09:09:26Z","git_url":"git://github.com/OCA/stock-logistics-workflow.git","ssh_url":"git@github.com:OCA/stock-logistics-workflow.git","clone_url":"https://github.com/OCA/stock-logistics-workflow.git","svn_url":"https://github.com/OCA/stock-logistics-workflow","homepage":"","size":2797,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":61,"forks":94,"open_issues":61,"watchers":24,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202"},"html":{"href":"https://github.com/OCA/stock-logistics-workflow/pull/202"},"issue":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/issues/202"},"comments":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/issues/202/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/pulls/202/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/stock-logistics-workflow/statuses/a395df334b668583997d2fa7ef3ec793af925e3c"}}}}