{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments/36955270","id":36955270,"diff_hunk":"@@ -64,6 +69,17 @@ def copy_quotation(self):\n         msg = _('New revision created: %s') % self.name\n         self.message_post(body=msg)\n         old_revision.message_post(body=msg)\n+\n+        # set stored procurement group id on old order\n+        old_revision.write({'procurement_group_id': procurement_group_id})\n+\n+        # swap order lines of old and new order\n+        so_line = self.env['sale.order.line']\n+        old_lines = so_line.browse(old_revision.order_line.ids)\n+        new_lines = so_line.browse(self.order_line.ids)\n+        old_lines.write({'order_id': self.id})\n+        new_lines.write({'order_id': old_revision.id})","path":"sale_order_revision/model/sale_order.py","position":25,"original_position":25,"commit_id":"8266035967ab2606104934d73fc3a8a2601c4d4c","original_commit_id":"8266035967ab2606104934d73fc3a8a2601c4d4c","user":{"login":"eLBati","id":1033131,"avatar_url":"https://avatars.githubusercontent.com/u/1033131?v=3","gravatar_id":"","url":"https://api.github.com/users/eLBati","html_url":"https://github.com/eLBati","followers_url":"https://api.github.com/users/eLBati/followers","following_url":"https://api.github.com/users/eLBati/following{/other_user}","gists_url":"https://api.github.com/users/eLBati/gists{/gist_id}","starred_url":"https://api.github.com/users/eLBati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eLBati/subscriptions","organizations_url":"https://api.github.com/users/eLBati/orgs","repos_url":"https://api.github.com/users/eLBati/repos","events_url":"https://api.github.com/users/eLBati/events{/privacy}","received_events_url":"https://api.github.com/users/eLBati/received_events","type":"User","site_admin":false},"body":">\n> I wanted to do that, but I was afraid that after the\n> old_revision.order_line.write action, the new lines will now belong to the\n> old revision and thus self.order_line.ids will contain no items and the\n> second write action will be flawed.\n>\n>\n>\nDid this actually happen?\n","created_at":"2015-08-13T09:23:25Z","updated_at":"2015-08-13T09:23:25Z","html_url":"https://github.com/OCA/sale-workflow/pull/186#discussion_r36955270","pull_request_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/186","_links":{"self":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments/36955270"},"html":{"href":"https://github.com/OCA/sale-workflow/pull/186#discussion_r36955270"},"pull_request":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/186"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/sale-workflow/pulls/186","id":40255500,"html_url":"https://github.com/OCA/sale-workflow/pull/186","diff_url":"https://github.com/OCA/sale-workflow/pull/186.diff","patch_url":"https://github.com/OCA/sale-workflow/pull/186.patch","issue_url":"https://api.github.com/repos/OCA/sale-workflow/issues/186","number":186,"state":"open","locked":false,"title":"[FIX] sale_order_revision #184","user":{"login":"antiflu","id":1466356,"avatar_url":"https://avatars.githubusercontent.com/u/1466356?v=3","gravatar_id":"","url":"https://api.github.com/users/antiflu","html_url":"https://github.com/antiflu","followers_url":"https://api.github.com/users/antiflu/followers","following_url":"https://api.github.com/users/antiflu/following{/other_user}","gists_url":"https://api.github.com/users/antiflu/gists{/gist_id}","starred_url":"https://api.github.com/users/antiflu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antiflu/subscriptions","organizations_url":"https://api.github.com/users/antiflu/orgs","repos_url":"https://api.github.com/users/antiflu/repos","events_url":"https://api.github.com/users/antiflu/events{/privacy}","received_events_url":"https://api.github.com/users/antiflu/received_events","type":"User","site_admin":false},"body":"Fix: set new order lines to draft and old ones to cancel.\r\n\r\nRationale: the way this module creates a new revision is that the old, cancelled revision is renamed to the new revision, then a copy is created and named after the old revision. As a result the lines of the old revision (copy) have state \"draft\" (the default) and the lines of the new revision have state \"cancel\". It should be the other way around. So, this fix switches the states around.","created_at":"2015-07-17T17:56:33Z","updated_at":"2015-08-13T09:23:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97ea0d2d544128b04614f2cb75c00d8636b19389","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/186/commits","review_comments_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/186/comments","review_comment_url":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/sale-workflow/issues/186/comments","statuses_url":"https://api.github.com/repos/OCA/sale-workflow/statuses/8266035967ab2606104934d73fc3a8a2601c4d4c","head":{"label":"antiflu:8.0","ref":"8.0","sha":"8266035967ab2606104934d73fc3a8a2601c4d4c","user":{"login":"antiflu","id":1466356,"avatar_url":"https://avatars.githubusercontent.com/u/1466356?v=3","gravatar_id":"","url":"https://api.github.com/users/antiflu","html_url":"https://github.com/antiflu","followers_url":"https://api.github.com/users/antiflu/followers","following_url":"https://api.github.com/users/antiflu/following{/other_user}","gists_url":"https://api.github.com/users/antiflu/gists{/gist_id}","starred_url":"https://api.github.com/users/antiflu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antiflu/subscriptions","organizations_url":"https://api.github.com/users/antiflu/orgs","repos_url":"https://api.github.com/users/antiflu/repos","events_url":"https://api.github.com/users/antiflu/events{/privacy}","received_events_url":"https://api.github.com/users/antiflu/received_events","type":"User","site_admin":false},"repo":{"id":39267509,"name":"sale-workflow","full_name":"antiflu/sale-workflow","owner":{"login":"antiflu","id":1466356,"avatar_url":"https://avatars.githubusercontent.com/u/1466356?v=3","gravatar_id":"","url":"https://api.github.com/users/antiflu","html_url":"https://github.com/antiflu","followers_url":"https://api.github.com/users/antiflu/followers","following_url":"https://api.github.com/users/antiflu/following{/other_user}","gists_url":"https://api.github.com/users/antiflu/gists{/gist_id}","starred_url":"https://api.github.com/users/antiflu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antiflu/subscriptions","organizations_url":"https://api.github.com/users/antiflu/orgs","repos_url":"https://api.github.com/users/antiflu/repos","events_url":"https://api.github.com/users/antiflu/events{/privacy}","received_events_url":"https://api.github.com/users/antiflu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antiflu/sale-workflow","description":"Odoo Sales, Workflow and Organization","fork":true,"url":"https://api.github.com/repos/antiflu/sale-workflow","forks_url":"https://api.github.com/repos/antiflu/sale-workflow/forks","keys_url":"https://api.github.com/repos/antiflu/sale-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antiflu/sale-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antiflu/sale-workflow/teams","hooks_url":"https://api.github.com/repos/antiflu/sale-workflow/hooks","issue_events_url":"https://api.github.com/repos/antiflu/sale-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/antiflu/sale-workflow/events","assignees_url":"https://api.github.com/repos/antiflu/sale-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/antiflu/sale-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/antiflu/sale-workflow/tags","blobs_url":"https://api.github.com/repos/antiflu/sale-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antiflu/sale-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antiflu/sale-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/antiflu/sale-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antiflu/sale-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/antiflu/sale-workflow/languages","stargazers_url":"https://api.github.com/repos/antiflu/sale-workflow/stargazers","contributors_url":"https://api.github.com/repos/antiflu/sale-workflow/contributors","subscribers_url":"https://api.github.com/repos/antiflu/sale-workflow/subscribers","subscription_url":"https://api.github.com/repos/antiflu/sale-workflow/subscription","commits_url":"https://api.github.com/repos/antiflu/sale-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/antiflu/sale-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/antiflu/sale-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/antiflu/sale-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/antiflu/sale-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/antiflu/sale-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antiflu/sale-workflow/merges","archive_url":"https://api.github.com/repos/antiflu/sale-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antiflu/sale-workflow/downloads","issues_url":"https://api.github.com/repos/antiflu/sale-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/antiflu/sale-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/antiflu/sale-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/antiflu/sale-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antiflu/sale-workflow/labels{/name}","releases_url":"https://api.github.com/repos/antiflu/sale-workflow/releases{/id}","created_at":"2015-07-17T17:51:59Z","updated_at":"2015-07-17T17:51:59Z","pushed_at":"2015-08-05T11:31:28Z","git_url":"git://github.com/antiflu/sale-workflow.git","ssh_url":"git@github.com:antiflu/sale-workflow.git","clone_url":"https://github.com/antiflu/sale-workflow.git","svn_url":"https://github.com/antiflu/sale-workflow","homepage":"","size":1265,"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":"d0a23572f49ef5ca77283a62e30c5ccabdb1f018","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":20882412,"name":"sale-workflow","full_name":"OCA/sale-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/sale-workflow","description":"Odoo Sales, Workflow and Organization","fork":false,"url":"https://api.github.com/repos/OCA/sale-workflow","forks_url":"https://api.github.com/repos/OCA/sale-workflow/forks","keys_url":"https://api.github.com/repos/OCA/sale-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/sale-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/sale-workflow/teams","hooks_url":"https://api.github.com/repos/OCA/sale-workflow/hooks","issue_events_url":"https://api.github.com/repos/OCA/sale-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/sale-workflow/events","assignees_url":"https://api.github.com/repos/OCA/sale-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/sale-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/sale-workflow/tags","blobs_url":"https://api.github.com/repos/OCA/sale-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/sale-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/sale-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/sale-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/sale-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/sale-workflow/languages","stargazers_url":"https://api.github.com/repos/OCA/sale-workflow/stargazers","contributors_url":"https://api.github.com/repos/OCA/sale-workflow/contributors","subscribers_url":"https://api.github.com/repos/OCA/sale-workflow/subscribers","subscription_url":"https://api.github.com/repos/OCA/sale-workflow/subscription","commits_url":"https://api.github.com/repos/OCA/sale-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/sale-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/sale-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/sale-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/sale-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/sale-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/sale-workflow/merges","archive_url":"https://api.github.com/repos/OCA/sale-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/sale-workflow/downloads","issues_url":"https://api.github.com/repos/OCA/sale-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/sale-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/sale-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/sale-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/sale-workflow/labels{/name}","releases_url":"https://api.github.com/repos/OCA/sale-workflow/releases{/id}","created_at":"2014-06-16T11:26:39Z","updated_at":"2015-08-12T10:14:04Z","pushed_at":"2015-08-13T07:09:10Z","git_url":"git://github.com/OCA/sale-workflow.git","ssh_url":"git@github.com:OCA/sale-workflow.git","clone_url":"https://github.com/OCA/sale-workflow.git","svn_url":"https://github.com/OCA/sale-workflow","homepage":"","size":4647,"stargazers_count":17,"watchers_count":17,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":59,"forks":86,"open_issues":59,"watchers":17,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/186"},"html":{"href":"https://github.com/OCA/sale-workflow/pull/186"},"issue":{"href":"https://api.github.com/repos/OCA/sale-workflow/issues/186"},"comments":{"href":"https://api.github.com/repos/OCA/sale-workflow/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/sale-workflow/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/sale-workflow/statuses/8266035967ab2606104934d73fc3a8a2601c4d4c"}}}}