{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/account-financial-tools/pulls/comments/28320636","id":28320636,"diff_hunk":"@@ -59,63 +56,58 @@ def _move_reversal(self, cr, uid, move, reversal_date,\n \n         :return: Returns the id of the created reversal move\n         \"\"\"\n-        if context is None:\n-            context = {}\n-        move_line_obj = self.pool.get('account.move.line')\n-        period_obj = self.pool.get('account.period')\n-        period_ctx = context.copy()\n-        period_ctx['company_id'] = move.company_id.id\n-        period_ctx['account_period_prefer_normal'] = True\n+        period_obj = self.env['account.period']\n \n         if not reversal_period_id:\n-            reversal_period_id = period_obj.find(\n-                cr, uid, reversal_date, context=period_ctx)[0]\n+            reversal_period_id = period_obj.with_context(\n+                company_id=self.company_id.id,\n+                account_period_prefer_normal=True).find(reversal_date)[0]\n         if not reversal_journal_id:\n-            reversal_journal_id = move.journal_id.id\n-\n-        reversal_ref = ''.join([x for x in [move_prefix, move.ref] if x])\n-        reversal_move_id = self.copy(cr, uid, move.id,\n-                                     default={\n-                                         'date': reversal_date,\n-                                         'period_id': reversal_period_id,\n-                                         'ref': reversal_ref,\n-                                         'journal_id': reversal_journal_id,\n-                                         'to_be_reversed': False,\n-                                     },\n-                                     context=context)\n-\n-        self.write(cr, uid, [move.id],\n-                   {'reversal_id': reversal_move_id,\n-                    # ensure to_be_reversed is true if ever it was not\n-                    'to_be_reversed': True},\n-                   context=context)\n-\n-        reversal_move = self.browse(cr, uid, reversal_move_id, context=context)\n+            reversal_journal_id = self.journal_id.id\n+\n+        if self.env['account.journal'].browse([","path":"account_reversal/account_reversal.py","position":92,"original_position":92,"commit_id":"27245ee7d10d3d15ef6d95b0d2c01a3f6fdaace9","original_commit_id":"720dd28faefbe439e213a268e8d28401e7001b30","user":{"login":"bringsvor","id":7498104,"avatar_url":"https://avatars.githubusercontent.com/u/7498104?v=3","gravatar_id":"","url":"https://api.github.com/users/bringsvor","html_url":"https://github.com/bringsvor","followers_url":"https://api.github.com/users/bringsvor/followers","following_url":"https://api.github.com/users/bringsvor/following{/other_user}","gists_url":"https://api.github.com/users/bringsvor/gists{/gist_id}","starred_url":"https://api.github.com/users/bringsvor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bringsvor/subscriptions","organizations_url":"https://api.github.com/users/bringsvor/orgs","repos_url":"https://api.github.com/users/bringsvor/repos","events_url":"https://api.github.com/users/bringsvor/events{/privacy}","received_events_url":"https://api.github.com/users/bringsvor/received_events","type":"User","site_admin":false},"body":"Which checks do you mean? It is a bit difficult for me to see from the fragment. I have done as little as possible to the module, so probably any checks are there from the old version.","created_at":"2015-04-14T12:07:36Z","updated_at":"2015-04-14T12:07:36Z","html_url":"https://github.com/OCA/account-financial-tools/pull/94#discussion_r28320636","pull_request_url":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/OCA/account-financial-tools/pulls/comments/28320636"},"html":{"href":"https://github.com/OCA/account-financial-tools/pull/94#discussion_r28320636"},"pull_request":{"href":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94","id":25301122,"html_url":"https://github.com/OCA/account-financial-tools/pull/94","diff_url":"https://github.com/OCA/account-financial-tools/pull/94.diff","patch_url":"https://github.com/OCA/account-financial-tools/pull/94.patch","issue_url":"https://api.github.com/repos/OCA/account-financial-tools/issues/94","number":94,"state":"open","locked":false,"title":"account_reversal - Rewritten for new api","user":{"login":"bringsvor","id":7498104,"avatar_url":"https://avatars.githubusercontent.com/u/7498104?v=3","gravatar_id":"","url":"https://api.github.com/users/bringsvor","html_url":"https://github.com/bringsvor","followers_url":"https://api.github.com/users/bringsvor/followers","following_url":"https://api.github.com/users/bringsvor/following{/other_user}","gists_url":"https://api.github.com/users/bringsvor/gists{/gist_id}","starred_url":"https://api.github.com/users/bringsvor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bringsvor/subscriptions","organizations_url":"https://api.github.com/users/bringsvor/orgs","repos_url":"https://api.github.com/users/bringsvor/repos","events_url":"https://api.github.com/users/bringsvor/events{/privacy}","received_events_url":"https://api.github.com/users/bringsvor/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-01T21:42:56Z","updated_at":"2015-04-14T12:07:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"876189ec6f94f33453a2394c170453b56cc832ec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94/commits","review_comments_url":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94/comments","review_comment_url":"https://api.github.com/repos/OCA/account-financial-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/account-financial-tools/issues/94/comments","statuses_url":"https://api.github.com/repos/OCA/account-financial-tools/statuses/27245ee7d10d3d15ef6d95b0d2c01a3f6fdaace9","head":{"label":"bringsvor:reversal_newapi","ref":"reversal_newapi","sha":"27245ee7d10d3d15ef6d95b0d2c01a3f6fdaace9","user":{"login":"bringsvor","id":7498104,"avatar_url":"https://avatars.githubusercontent.com/u/7498104?v=3","gravatar_id":"","url":"https://api.github.com/users/bringsvor","html_url":"https://github.com/bringsvor","followers_url":"https://api.github.com/users/bringsvor/followers","following_url":"https://api.github.com/users/bringsvor/following{/other_user}","gists_url":"https://api.github.com/users/bringsvor/gists{/gist_id}","starred_url":"https://api.github.com/users/bringsvor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bringsvor/subscriptions","organizations_url":"https://api.github.com/users/bringsvor/orgs","repos_url":"https://api.github.com/users/bringsvor/repos","events_url":"https://api.github.com/users/bringsvor/events{/privacy}","received_events_url":"https://api.github.com/users/bringsvor/received_events","type":"User","site_admin":false},"repo":{"id":25033178,"name":"account-financial-tools","full_name":"bringsvor/account-financial-tools","owner":{"login":"bringsvor","id":7498104,"avatar_url":"https://avatars.githubusercontent.com/u/7498104?v=3","gravatar_id":"","url":"https://api.github.com/users/bringsvor","html_url":"https://github.com/bringsvor","followers_url":"https://api.github.com/users/bringsvor/followers","following_url":"https://api.github.com/users/bringsvor/following{/other_user}","gists_url":"https://api.github.com/users/bringsvor/gists{/gist_id}","starred_url":"https://api.github.com/users/bringsvor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bringsvor/subscriptions","organizations_url":"https://api.github.com/users/bringsvor/orgs","repos_url":"https://api.github.com/users/bringsvor/repos","events_url":"https://api.github.com/users/bringsvor/events{/privacy}","received_events_url":"https://api.github.com/users/bringsvor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bringsvor/account-financial-tools","description":"","fork":true,"url":"https://api.github.com/repos/bringsvor/account-financial-tools","forks_url":"https://api.github.com/repos/bringsvor/account-financial-tools/forks","keys_url":"https://api.github.com/repos/bringsvor/account-financial-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bringsvor/account-financial-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bringsvor/account-financial-tools/teams","hooks_url":"https://api.github.com/repos/bringsvor/account-financial-tools/hooks","issue_events_url":"https://api.github.com/repos/bringsvor/account-financial-tools/issues/events{/number}","events_url":"https://api.github.com/repos/bringsvor/account-financial-tools/events","assignees_url":"https://api.github.com/repos/bringsvor/account-financial-tools/assignees{/user}","branches_url":"https://api.github.com/repos/bringsvor/account-financial-tools/branches{/branch}","tags_url":"https://api.github.com/repos/bringsvor/account-financial-tools/tags","blobs_url":"https://api.github.com/repos/bringsvor/account-financial-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bringsvor/account-financial-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bringsvor/account-financial-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/bringsvor/account-financial-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bringsvor/account-financial-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/bringsvor/account-financial-tools/languages","stargazers_url":"https://api.github.com/repos/bringsvor/account-financial-tools/stargazers","contributors_url":"https://api.github.com/repos/bringsvor/account-financial-tools/contributors","subscribers_url":"https://api.github.com/repos/bringsvor/account-financial-tools/subscribers","subscription_url":"https://api.github.com/repos/bringsvor/account-financial-tools/subscription","commits_url":"https://api.github.com/repos/bringsvor/account-financial-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/bringsvor/account-financial-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/bringsvor/account-financial-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/bringsvor/account-financial-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/bringsvor/account-financial-tools/contents/{+path}","compare_url":"https://api.github.com/repos/bringsvor/account-financial-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bringsvor/account-financial-tools/merges","archive_url":"https://api.github.com/repos/bringsvor/account-financial-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bringsvor/account-financial-tools/downloads","issues_url":"https://api.github.com/repos/bringsvor/account-financial-tools/issues{/number}","pulls_url":"https://api.github.com/repos/bringsvor/account-financial-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/bringsvor/account-financial-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/bringsvor/account-financial-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bringsvor/account-financial-tools/labels{/name}","releases_url":"https://api.github.com/repos/bringsvor/account-financial-tools/releases{/id}","created_at":"2014-10-10T11:48:38Z","updated_at":"2014-12-01T21:39:12Z","pushed_at":"2015-04-14T11:47:10Z","git_url":"git://github.com/bringsvor/account-financial-tools.git","ssh_url":"git@github.com:bringsvor/account-financial-tools.git","clone_url":"https://github.com/bringsvor/account-financial-tools.git","svn_url":"https://github.com/bringsvor/account-financial-tools","homepage":null,"size":3223,"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":"208b00cfc0e81604de6c20e46c99b8bdd2c38cc0","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":20881761,"name":"account-financial-tools","full_name":"OCA/account-financial-tools","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/account-financial-tools","description":"Odoo Accountant Financial Tools and Utils","fork":false,"url":"https://api.github.com/repos/OCA/account-financial-tools","forks_url":"https://api.github.com/repos/OCA/account-financial-tools/forks","keys_url":"https://api.github.com/repos/OCA/account-financial-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/account-financial-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/account-financial-tools/teams","hooks_url":"https://api.github.com/repos/OCA/account-financial-tools/hooks","issue_events_url":"https://api.github.com/repos/OCA/account-financial-tools/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/account-financial-tools/events","assignees_url":"https://api.github.com/repos/OCA/account-financial-tools/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/account-financial-tools/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/account-financial-tools/tags","blobs_url":"https://api.github.com/repos/OCA/account-financial-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/account-financial-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/account-financial-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/account-financial-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/account-financial-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/account-financial-tools/languages","stargazers_url":"https://api.github.com/repos/OCA/account-financial-tools/stargazers","contributors_url":"https://api.github.com/repos/OCA/account-financial-tools/contributors","subscribers_url":"https://api.github.com/repos/OCA/account-financial-tools/subscribers","subscription_url":"https://api.github.com/repos/OCA/account-financial-tools/subscription","commits_url":"https://api.github.com/repos/OCA/account-financial-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/account-financial-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/account-financial-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/account-financial-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/account-financial-tools/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/account-financial-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/account-financial-tools/merges","archive_url":"https://api.github.com/repos/OCA/account-financial-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/account-financial-tools/downloads","issues_url":"https://api.github.com/repos/OCA/account-financial-tools/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/account-financial-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/account-financial-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/account-financial-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/account-financial-tools/labels{/name}","releases_url":"https://api.github.com/repos/OCA/account-financial-tools/releases{/id}","created_at":"2014-06-16T10:58:57Z","updated_at":"2015-04-13T10:51:06Z","pushed_at":"2015-04-14T11:47:10Z","git_url":"git://github.com/OCA/account-financial-tools.git","ssh_url":"git@github.com:OCA/account-financial-tools.git","clone_url":"https://github.com/OCA/account-financial-tools.git","svn_url":"https://github.com/OCA/account-financial-tools","homepage":"","size":6819,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":45,"forks":72,"open_issues":45,"watchers":20,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94"},"html":{"href":"https://github.com/OCA/account-financial-tools/pull/94"},"issue":{"href":"https://api.github.com/repos/OCA/account-financial-tools/issues/94"},"comments":{"href":"https://api.github.com/repos/OCA/account-financial-tools/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/account-financial-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/account-financial-tools/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/account-financial-tools/statuses/27245ee7d10d3d15ef6d95b0d2c01a3f6fdaace9"}}}}