{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/account-invoicing/pulls/comments/72239408","id":72239408,"diff_hunk":"@@ -0,0 +1,36 @@\n+# -*- coding: utf-8 -*-\n+# Copyright 2004-2011 Pexego Sistemas Informáticos. (http://pexego.es)\n+# Copyright 2014 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>\n+# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n+\n+from openerp import models, fields, api\n+\n+\n+class AccountInvoice(models.Model):\n+    _inherit = 'account.invoice'\n+\n+    refund_reason = fields.Text(string=\"Refund reason\")\n+    origin_invoice_ids = fields.Many2many(\n+        comodel_name='account.invoice', column1='refund_invoice_id',\n+        column2='original_invoice_id', relation='account_invoice_refunds_rel',\n+        string=\"Original invoice\", readonly=True,\n+        help=\"Links to original invoice which is referred this refund invoice\")\n+    refund_invoice_ids = fields.Many2many(\n+        comodel_name='account.invoice', column1='original_invoice_id',\n+        column2='refund_invoice_id', relation='account_invoice_refunds_rel',\n+        string=\"Refund invoices\",  readonly=True,\n+        help=\"Links to refund invoices related with this invoice\")\n+\n+    @api.multi\n+    def match_origin_lines(self, origin_inv):\n+        for idx, line in enumerate(origin_inv.invoice_line_ids):\n+            try:\n+                # Protect this write, maybe refund invoice doesn't\n+                # have the same lines than original one\n+                self.invoice_line_ids[idx].write({\n+                    'origin_line_ids': [(6, 0, line.ids)],\n+                })\n+            except:","path":"account_invoice_refund_link/models/account_invoice.py","position":34,"original_position":34,"commit_id":"4b4abb58f1407e2c03d7358a5094da30d36ed002","original_commit_id":"4b4abb58f1407e2c03d7358a5094da30d36ed002","user":{"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},"body":"Put here and in the following line `# pragma: no cover` for avoiding a drop in coveralls without reason","created_at":"2016-07-26T12:33:31Z","updated_at":"2016-07-26T12:33:31Z","html_url":"https://github.com/OCA/account-invoicing/pull/172#discussion_r72239408","pull_request_url":"https://api.github.com/repos/OCA/account-invoicing/pulls/172","_links":{"self":{"href":"https://api.github.com/repos/OCA/account-invoicing/pulls/comments/72239408"},"html":{"href":"https://github.com/OCA/account-invoicing/pull/172#discussion_r72239408"},"pull_request":{"href":"https://api.github.com/repos/OCA/account-invoicing/pulls/172"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/account-invoicing/pulls/172","id":78719363,"html_url":"https://github.com/OCA/account-invoicing/pull/172","diff_url":"https://github.com/OCA/account-invoicing/pull/172.diff","patch_url":"https://github.com/OCA/account-invoicing/pull/172.patch","issue_url":"https://api.github.com/repos/OCA/account-invoicing/issues/172","number":172,"state":"open","locked":false,"title":"[9.0][MIG] account_refund_original","user":{"login":"antespi","id":1881111,"avatar_url":"https://avatars.githubusercontent.com/u/1881111?v=3","gravatar_id":"","url":"https://api.github.com/users/antespi","html_url":"https://github.com/antespi","followers_url":"https://api.github.com/users/antespi/followers","following_url":"https://api.github.com/users/antespi/following{/other_user}","gists_url":"https://api.github.com/users/antespi/gists{/gist_id}","starred_url":"https://api.github.com/users/antespi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antespi/subscriptions","organizations_url":"https://api.github.com/users/antespi/orgs","repos_url":"https://api.github.com/users/antespi/repos","events_url":"https://api.github.com/users/antespi/events{/privacy}","received_events_url":"https://api.github.com/users/antespi/received_events","type":"User","site_admin":false},"body":"* Rename addon to ```account_invoice_refund_link```\r\n* OCA Guidelines complaince \r\n* Test added\r\n* Rename field ```origin_invoices_ids``` to ```origin_invoice_ids```\r\n* Rename field ```refund_invoices_description``` to ```refund_reason```\r\n* Show refund invoices created in a normal invoice\r\n* Link invoice lines between refund an original invoice ","created_at":"2016-07-25T17:23:37Z","updated_at":"2016-07-26T12:33:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fc1c31fd5e1d3ba18d38214c2c0424294000ae7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OCA/account-invoicing/pulls/172/commits","review_comments_url":"https://api.github.com/repos/OCA/account-invoicing/pulls/172/comments","review_comment_url":"https://api.github.com/repos/OCA/account-invoicing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/account-invoicing/issues/172/comments","statuses_url":"https://api.github.com/repos/OCA/account-invoicing/statuses/4b4abb58f1407e2c03d7358a5094da30d36ed002","head":{"label":"Tecnativa:9.0-account_refund_original","ref":"9.0-account_refund_original","sha":"4b4abb58f1407e2c03d7358a5094da30d36ed002","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":59533057,"name":"account-invoicing","full_name":"Tecnativa/account-invoicing","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/account-invoicing","description":"Odoo Invoicing Extension Addons","fork":true,"url":"https://api.github.com/repos/Tecnativa/account-invoicing","forks_url":"https://api.github.com/repos/Tecnativa/account-invoicing/forks","keys_url":"https://api.github.com/repos/Tecnativa/account-invoicing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tecnativa/account-invoicing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tecnativa/account-invoicing/teams","hooks_url":"https://api.github.com/repos/Tecnativa/account-invoicing/hooks","issue_events_url":"https://api.github.com/repos/Tecnativa/account-invoicing/issues/events{/number}","events_url":"https://api.github.com/repos/Tecnativa/account-invoicing/events","assignees_url":"https://api.github.com/repos/Tecnativa/account-invoicing/assignees{/user}","branches_url":"https://api.github.com/repos/Tecnativa/account-invoicing/branches{/branch}","tags_url":"https://api.github.com/repos/Tecnativa/account-invoicing/tags","blobs_url":"https://api.github.com/repos/Tecnativa/account-invoicing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tecnativa/account-invoicing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tecnativa/account-invoicing/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tecnativa/account-invoicing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tecnativa/account-invoicing/statuses/{sha}","languages_url":"https://api.github.com/repos/Tecnativa/account-invoicing/languages","stargazers_url":"https://api.github.com/repos/Tecnativa/account-invoicing/stargazers","contributors_url":"https://api.github.com/repos/Tecnativa/account-invoicing/contributors","subscribers_url":"https://api.github.com/repos/Tecnativa/account-invoicing/subscribers","subscription_url":"https://api.github.com/repos/Tecnativa/account-invoicing/subscription","commits_url":"https://api.github.com/repos/Tecnativa/account-invoicing/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tecnativa/account-invoicing/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tecnativa/account-invoicing/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tecnativa/account-invoicing/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tecnativa/account-invoicing/contents/{+path}","compare_url":"https://api.github.com/repos/Tecnativa/account-invoicing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tecnativa/account-invoicing/merges","archive_url":"https://api.github.com/repos/Tecnativa/account-invoicing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tecnativa/account-invoicing/downloads","issues_url":"https://api.github.com/repos/Tecnativa/account-invoicing/issues{/number}","pulls_url":"https://api.github.com/repos/Tecnativa/account-invoicing/pulls{/number}","milestones_url":"https://api.github.com/repos/Tecnativa/account-invoicing/milestones{/number}","notifications_url":"https://api.github.com/repos/Tecnativa/account-invoicing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tecnativa/account-invoicing/labels{/name}","releases_url":"https://api.github.com/repos/Tecnativa/account-invoicing/releases{/id}","deployments_url":"https://api.github.com/repos/Tecnativa/account-invoicing/deployments","created_at":"2016-05-24T02:13:53Z","updated_at":"2016-05-24T02:13:55Z","pushed_at":"2016-07-26T12:08:38Z","git_url":"git://github.com/Tecnativa/account-invoicing.git","ssh_url":"git@github.com:Tecnativa/account-invoicing.git","clone_url":"https://github.com/Tecnativa/account-invoicing.git","svn_url":"https://github.com/Tecnativa/account-invoicing","homepage":"","size":1391,"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":"9.0"}},"base":{"label":"OCA:9.0","ref":"9.0","sha":"7980fdf309608cd42566729ff9e6144b91d30a1e","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":20881777,"name":"account-invoicing","full_name":"OCA/account-invoicing","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-invoicing","description":"Odoo Invoicing Extension Addons","fork":false,"url":"https://api.github.com/repos/OCA/account-invoicing","forks_url":"https://api.github.com/repos/OCA/account-invoicing/forks","keys_url":"https://api.github.com/repos/OCA/account-invoicing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/account-invoicing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/account-invoicing/teams","hooks_url":"https://api.github.com/repos/OCA/account-invoicing/hooks","issue_events_url":"https://api.github.com/repos/OCA/account-invoicing/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/account-invoicing/events","assignees_url":"https://api.github.com/repos/OCA/account-invoicing/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/account-invoicing/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/account-invoicing/tags","blobs_url":"https://api.github.com/repos/OCA/account-invoicing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/account-invoicing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/account-invoicing/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/account-invoicing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/account-invoicing/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/account-invoicing/languages","stargazers_url":"https://api.github.com/repos/OCA/account-invoicing/stargazers","contributors_url":"https://api.github.com/repos/OCA/account-invoicing/contributors","subscribers_url":"https://api.github.com/repos/OCA/account-invoicing/subscribers","subscription_url":"https://api.github.com/repos/OCA/account-invoicing/subscription","commits_url":"https://api.github.com/repos/OCA/account-invoicing/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/account-invoicing/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/account-invoicing/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/account-invoicing/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/account-invoicing/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/account-invoicing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/account-invoicing/merges","archive_url":"https://api.github.com/repos/OCA/account-invoicing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/account-invoicing/downloads","issues_url":"https://api.github.com/repos/OCA/account-invoicing/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/account-invoicing/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/account-invoicing/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/account-invoicing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/account-invoicing/labels{/name}","releases_url":"https://api.github.com/repos/OCA/account-invoicing/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/account-invoicing/deployments","created_at":"2014-06-16T10:59:46Z","updated_at":"2016-05-26T11:11:47Z","pushed_at":"2016-07-26T12:08:39Z","git_url":"git://github.com/OCA/account-invoicing.git","ssh_url":"git@github.com:OCA/account-invoicing.git","clone_url":"https://github.com/OCA/account-invoicing.git","svn_url":"https://github.com/OCA/account-invoicing","homepage":"","size":2799,"stargazers_count":23,"watchers_count":23,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":120,"mirror_url":null,"open_issues_count":54,"forks":120,"open_issues":54,"watchers":23,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/account-invoicing/pulls/172"},"html":{"href":"https://github.com/OCA/account-invoicing/pull/172"},"issue":{"href":"https://api.github.com/repos/OCA/account-invoicing/issues/172"},"comments":{"href":"https://api.github.com/repos/OCA/account-invoicing/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/account-invoicing/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/account-invoicing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/account-invoicing/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/account-invoicing/statuses/4b4abb58f1407e2c03d7358a5094da30d36ed002"}}}}
{"actor":{"display_login":"pedrobaeza"}}