{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/sale-workflow/pulls/comments/87807498","pull_request_review_id":8403510,"id":87807498,"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":null,"original_position":25,"commit_id":"91a4dbaee523d9114f2faa1a30bb8c81cf88e4c5","original_commit_id":"8266035967ab2606104934d73fc3a8a2601c4d4c","user":{"login":"thomaspaulb","id":1466356,"avatar_url":"https://avatars.githubusercontent.com/u/1466356?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaspaulb","html_url":"https://github.com/thomaspaulb","followers_url":"https://api.github.com/users/thomaspaulb/followers","following_url":"https://api.github.com/users/thomaspaulb/following{/other_user}","gists_url":"https://api.github.com/users/thomaspaulb/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaspaulb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaspaulb/subscriptions","organizations_url":"https://api.github.com/users/thomaspaulb/orgs","repos_url":"https://api.github.com/users/thomaspaulb/repos","events_url":"https://api.github.com/users/thomaspaulb/events{/privacy}","received_events_url":"https://api.github.com/users/thomaspaulb/received_events","type":"User","site_admin":false},"body":"I tested your shorter version; indeed it goes wrong, the old revision will contain both revision's lines and the new revision contains nothing.","created_at":"2016-11-14T14:14:57Z","updated_at":"2016-11-14T14:14:57Z","html_url":"https://github.com/OCA/sale-workflow/pull/186#discussion_r87807498","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/87807498"},"html":{"href":"https://github.com/OCA/sale-workflow/pull/186#discussion_r87807498"},"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":"thomaspaulb","id":1466356,"avatar_url":"https://avatars.githubusercontent.com/u/1466356?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaspaulb","html_url":"https://github.com/thomaspaulb","followers_url":"https://api.github.com/users/thomaspaulb/followers","following_url":"https://api.github.com/users/thomaspaulb/following{/other_user}","gists_url":"https://api.github.com/users/thomaspaulb/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaspaulb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaspaulb/subscriptions","organizations_url":"https://api.github.com/users/thomaspaulb/orgs","repos_url":"https://api.github.com/users/thomaspaulb/repos","events_url":"https://api.github.com/users/thomaspaulb/events{/privacy}","received_events_url":"https://api.github.com/users/thomaspaulb/received_events","type":"User","site_admin":false},"body":"Fix: set new order lines to draft and old ones to cancel.\n\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.\n","created_at":"2015-07-17T17:56:33Z","updated_at":"2016-11-14T14:14:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9092928af5caa881e3b7964dc91b45fd8e14b42b","assignee":null,"assignees":[],"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/91a4dbaee523d9114f2faa1a30bb8c81cf88e4c5","head":{"label":"thomaspaulb:8.0","ref":"8.0","sha":"91a4dbaee523d9114f2faa1a30bb8c81cf88e4c5","user":{"login":"thomaspaulb","id":1466356,"avatar_url":"https://avatars.githubusercontent.com/u/1466356?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaspaulb","html_url":"https://github.com/thomaspaulb","followers_url":"https://api.github.com/users/thomaspaulb/followers","following_url":"https://api.github.com/users/thomaspaulb/following{/other_user}","gists_url":"https://api.github.com/users/thomaspaulb/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaspaulb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaspaulb/subscriptions","organizations_url":"https://api.github.com/users/thomaspaulb/orgs","repos_url":"https://api.github.com/users/thomaspaulb/repos","events_url":"https://api.github.com/users/thomaspaulb/events{/privacy}","received_events_url":"https://api.github.com/users/thomaspaulb/received_events","type":"User","site_admin":false},"repo":{"id":39267509,"name":"sale-workflow","full_name":"thomaspaulb/sale-workflow","owner":{"login":"thomaspaulb","id":1466356,"avatar_url":"https://avatars.githubusercontent.com/u/1466356?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaspaulb","html_url":"https://github.com/thomaspaulb","followers_url":"https://api.github.com/users/thomaspaulb/followers","following_url":"https://api.github.com/users/thomaspaulb/following{/other_user}","gists_url":"https://api.github.com/users/thomaspaulb/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaspaulb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaspaulb/subscriptions","organizations_url":"https://api.github.com/users/thomaspaulb/orgs","repos_url":"https://api.github.com/users/thomaspaulb/repos","events_url":"https://api.github.com/users/thomaspaulb/events{/privacy}","received_events_url":"https://api.github.com/users/thomaspaulb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thomaspaulb/sale-workflow","description":"Odoo Sales, Workflow and Organization","fork":true,"url":"https://api.github.com/repos/thomaspaulb/sale-workflow","forks_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/forks","keys_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/teams","hooks_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/hooks","issue_events_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/issues/events{/number}","events_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/events","assignees_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/assignees{/user}","branches_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/branches{/branch}","tags_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/tags","blobs_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/statuses/{sha}","languages_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/languages","stargazers_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/stargazers","contributors_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/contributors","subscribers_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/subscribers","subscription_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/subscription","commits_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/contents/{+path}","compare_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/merges","archive_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/downloads","issues_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/issues{/number}","pulls_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/pulls{/number}","milestones_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/milestones{/number}","notifications_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/labels{/name}","releases_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/releases{/id}","deployments_url":"https://api.github.com/repos/thomaspaulb/sale-workflow/deployments","created_at":"2015-07-17T17:51:59Z","updated_at":"2016-11-14T14:03:40Z","pushed_at":"2016-11-14T14:10:43Z","git_url":"git://github.com/thomaspaulb/sale-workflow.git","ssh_url":"git@github.com:thomaspaulb/sale-workflow.git","clone_url":"https://github.com/thomaspaulb/sale-workflow.git","svn_url":"https://github.com/thomaspaulb/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}","deployments_url":"https://api.github.com/repos/OCA/sale-workflow/deployments","created_at":"2014-06-16T11:26:39Z","updated_at":"2016-11-08T15:42:18Z","pushed_at":"2016-11-14T14:12:06Z","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":7067,"stargazers_count":35,"watchers_count":35,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"open_issues_count":78,"forks":181,"open_issues":78,"watchers":35,"default_branch":"10.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/91a4dbaee523d9114f2faa1a30bb8c81cf88e4c5"}}}}
{"actor":{"display_login":"thomaspaulb"}}