GitHub PullRequestReviewCommentEvent at 2014-10-11 08:53:30
Repository: odoomrp-wip
Actor: pedrobaeza
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/18740346","id":18740346,"diff_hunk":"@@ -0,0 +1,251 @@\n+\n+# -*- encoding: utf-8 -*-\n+##############################################################################\n+#\n+#    OpenERP, Open Source Management Solution\n+#    Copyright (C) 2009 Albert Cervera i Areny (http://www.nan-tic.com).\n+#    Copyright (c) 2011 Pexego Sistemas Informáticos.\n+#                       Alberto Luengo Cabanillas <alberto@pexego.es>\n+#    Copyright (c) 2014 Factor Libre SL. All Rights Reserved\n+#\n+#    This program is free software: you can redistribute it and/or modify\n+#    it under the terms of the GNU General Public License as published by\n+#    the Free Software Foundation, either version 3 of the License, or\n+#    (at your option) any later version.\n+#\n+#    This program is distributed in the hope that it will be useful,\n+#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+#    GNU General Public License for more details.\n+#\n+#    You should have received a copy of the GNU General Public License\n+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+#\n+##############################################################################\n+\n+from openerp import models, fields, api, _\n+\n+\n+class ResPartner(models.Model):\n+    _inherit = 'res.partner'\n+\n+    @api.multi\n+    @api.depends('unpayed_amount')\n+    def _unpayed_amount(self):\n+        move_line_obj = self.env['account.move.line']\n+        account_obj = self.env['account.account']\n+        today = fields.date.today()\n+        for partner in self:\n+            account_lst = account_obj.search(['|', ('type', '=', 'receivable'),\n+                                              ('type', '=', 'payable')]).ids\n+            line_ids = move_line_obj.search([('partner_id', '=', partner.id),\n+                                             ('account_id', 'in', account_lst),\n+                                             ('reconcile_id', '=', False),\n+                                             ('date_maturity', '<', today)])\n+            # Those that have amount_residual == 0, will mean that they're\n+            # circulating. The payment request has been sent to the bank but\n+            # have not yet been reconciled (or the date_maturity has not been\n+            # reached).\n+            amount = 0.0\n+            for line in line_ids:\n+                # amount += -line.amount_to_pay\n+                amount += line.debit - line.credit\n+            partner.unpayed_amount = amount\n+\n+    @api.multi\n+    @api.depends('circulating_amount')","path":"partner_risk/models/res_partner.py","position":56,"original_position":56,"commit_id":"67fd6792891542f52ff44761c82e6c7010f2676e","original_commit_id":"67fd6792891542f52ff44761c82e6c7010f2676e","user":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=2","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":"Ídem. Pon los campos de los que depende su cálculo, no a si mismo.","created_at":"2014-10-11T08:53:30Z","updated_at":"2014-10-11T08:53:30Z","html_url":"https://github.com/odoomrp/odoomrp-wip/pull/152#discussion_r18740346","pull_request_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152","_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/18740346"},"html":{"href":"https://github.com/odoomrp/odoomrp-wip/pull/152#discussion_r18740346"},"pull_request":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152"}}},"pull_request":{"url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152","id":22557006,"html_url":"https://github.com/odoomrp/odoomrp-wip/pull/152","diff_url":"https://github.com/odoomrp/odoomrp-wip/pull/152.diff","patch_url":"https://github.com/odoomrp/odoomrp-wip/pull/152.patch","issue_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/152","number":152,"state":"open","locked":false,"title":"[ADD] partner_risk","user":{"login":"Daniel-CA","id":7643575,"avatar_url":"https://avatars.githubusercontent.com/u/7643575?v=2","gravatar_id":"","url":"https://api.github.com/users/Daniel-CA","html_url":"https://github.com/Daniel-CA","followers_url":"https://api.github.com/users/Daniel-CA/followers","following_url":"https://api.github.com/users/Daniel-CA/following{/other_user}","gists_url":"https://api.github.com/users/Daniel-CA/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel-CA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel-CA/subscriptions","organizations_url":"https://api.github.com/users/Daniel-CA/orgs","repos_url":"https://api.github.com/users/Daniel-CA/repos","events_url":"https://api.github.com/users/Daniel-CA/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel-CA/received_events","type":"User","site_admin":false},"body":"Módulo partner_risk con nueva API","created_at":"2014-10-10T12:30:41Z","updated_at":"2014-10-11T08:53:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3e30f8e9941c0fe80ad3dfa014de6b5f7269030","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152/commits","review_comments_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152/comments","review_comment_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/{number}","comments_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/152/comments","statuses_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/statuses/67fd6792891542f52ff44761c82e6c7010f2676e","head":{"label":"Daniel-CA:partner_risk","ref":"partner_risk","sha":"67fd6792891542f52ff44761c82e6c7010f2676e","user":{"login":"Daniel-CA","id":7643575,"avatar_url":"https://avatars.githubusercontent.com/u/7643575?v=2","gravatar_id":"","url":"https://api.github.com/users/Daniel-CA","html_url":"https://github.com/Daniel-CA","followers_url":"https://api.github.com/users/Daniel-CA/followers","following_url":"https://api.github.com/users/Daniel-CA/following{/other_user}","gists_url":"https://api.github.com/users/Daniel-CA/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel-CA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel-CA/subscriptions","organizations_url":"https://api.github.com/users/Daniel-CA/orgs","repos_url":"https://api.github.com/users/Daniel-CA/repos","events_url":"https://api.github.com/users/Daniel-CA/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel-CA/received_events","type":"User","site_admin":false},"repo":{"id":24584015,"name":"odoomrp-wip-public","full_name":"Daniel-CA/odoomrp-wip-public","owner":{"login":"Daniel-CA","id":7643575,"avatar_url":"https://avatars.githubusercontent.com/u/7643575?v=2","gravatar_id":"","url":"https://api.github.com/users/Daniel-CA","html_url":"https://github.com/Daniel-CA","followers_url":"https://api.github.com/users/Daniel-CA/followers","following_url":"https://api.github.com/users/Daniel-CA/following{/other_user}","gists_url":"https://api.github.com/users/Daniel-CA/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel-CA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel-CA/subscriptions","organizations_url":"https://api.github.com/users/Daniel-CA/orgs","repos_url":"https://api.github.com/users/Daniel-CA/repos","events_url":"https://api.github.com/users/Daniel-CA/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel-CA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Daniel-CA/odoomrp-wip-public","description":"WIP of OdooMRP","fork":true,"url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public","forks_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/forks","keys_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/teams","hooks_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/hooks","issue_events_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/issues/events{/number}","events_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/events","assignees_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/assignees{/user}","branches_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/branches{/branch}","tags_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/tags","blobs_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/git/refs{/sha}","trees_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/statuses/{sha}","languages_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/languages","stargazers_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/stargazers","contributors_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/contributors","subscribers_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/subscribers","subscription_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/subscription","commits_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/commits{/sha}","git_commits_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/git/commits{/sha}","comments_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/comments{/number}","issue_comment_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/issues/comments/{number}","contents_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/contents/{+path}","compare_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/merges","archive_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/downloads","issues_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/issues{/number}","pulls_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/pulls{/number}","milestones_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/milestones{/number}","notifications_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/labels{/name}","releases_url":"https://api.github.com/repos/Daniel-CA/odoomrp-wip-public/releases{/id}","created_at":"2014-09-29T07:26:12Z","updated_at":"2014-09-29T10:17:08Z","pushed_at":"2014-10-10T12:29:42Z","git_url":"git://github.com/Daniel-CA/odoomrp-wip-public.git","ssh_url":"git@github.com:Daniel-CA/odoomrp-wip-public.git","clone_url":"https://github.com/Daniel-CA/odoomrp-wip-public.git","svn_url":"https://github.com/Daniel-CA/odoomrp-wip-public","homepage":"http://www.odoomrp.com","size":781,"stargazers_count":0,"watchers_count":0,"language":null,"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":"odoomrp:8.0","ref":"8.0","sha":"cb63b93aea0f41f5a7e692fcd7a554a36d04d735","user":{"login":"odoomrp","id":7858947,"avatar_url":"https://avatars.githubusercontent.com/u/7858947?v=2","gravatar_id":"","url":"https://api.github.com/users/odoomrp","html_url":"https://github.com/odoomrp","followers_url":"https://api.github.com/users/odoomrp/followers","following_url":"https://api.github.com/users/odoomrp/following{/other_user}","gists_url":"https://api.github.com/users/odoomrp/gists{/gist_id}","starred_url":"https://api.github.com/users/odoomrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoomrp/subscriptions","organizations_url":"https://api.github.com/users/odoomrp/orgs","repos_url":"https://api.github.com/users/odoomrp/repos","events_url":"https://api.github.com/users/odoomrp/events{/privacy}","received_events_url":"https://api.github.com/users/odoomrp/received_events","type":"Organization","site_admin":false},"repo":{"id":22124768,"name":"odoomrp-wip","full_name":"odoomrp/odoomrp-wip","owner":{"login":"odoomrp","id":7858947,"avatar_url":"https://avatars.githubusercontent.com/u/7858947?v=2","gravatar_id":"","url":"https://api.github.com/users/odoomrp","html_url":"https://github.com/odoomrp","followers_url":"https://api.github.com/users/odoomrp/followers","following_url":"https://api.github.com/users/odoomrp/following{/other_user}","gists_url":"https://api.github.com/users/odoomrp/gists{/gist_id}","starred_url":"https://api.github.com/users/odoomrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoomrp/subscriptions","organizations_url":"https://api.github.com/users/odoomrp/orgs","repos_url":"https://api.github.com/users/odoomrp/repos","events_url":"https://api.github.com/users/odoomrp/events{/privacy}","received_events_url":"https://api.github.com/users/odoomrp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoomrp/odoomrp-wip","description":"WIP of OdooMRP","fork":false,"url":"https://api.github.com/repos/odoomrp/odoomrp-wip","forks_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/forks","keys_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/teams","hooks_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/hooks","issue_events_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/events{/number}","events_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/events","assignees_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/assignees{/user}","branches_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/branches{/branch}","tags_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/tags","blobs_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/statuses/{sha}","languages_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/languages","stargazers_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/stargazers","contributors_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/contributors","subscribers_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/subscribers","subscription_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/subscription","commits_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/comments/{number}","contents_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/contents/{+path}","compare_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/merges","archive_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/downloads","issues_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues{/number}","pulls_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls{/number}","milestones_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/milestones{/number}","notifications_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/labels{/name}","releases_url":"https://api.github.com/repos/odoomrp/odoomrp-wip/releases{/id}","created_at":"2014-07-22T23:29:59Z","updated_at":"2014-10-08T16:11:04Z","pushed_at":"2014-10-10T14:38:47Z","git_url":"git://github.com/odoomrp/odoomrp-wip.git","ssh_url":"git@github.com:odoomrp/odoomrp-wip.git","clone_url":"https://github.com/odoomrp/odoomrp-wip.git","svn_url":"https://github.com/odoomrp/odoomrp-wip","homepage":"http://www.odoomrp.com","size":2940,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":21,"forks":9,"open_issues":21,"watchers":4,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152"},"html":{"href":"https://github.com/odoomrp/odoomrp-wip/pull/152"},"issue":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/152"},"comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/issues/152/comments"},"review_comments":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152/comments"},"review_comment":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/pulls/152/commits"},"statuses":{"href":"https://api.github.com/repos/odoomrp/odoomrp-wip/statuses/67fd6792891542f52ff44761c82e6c7010f2676e"}}}}