{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/l10n-spain/pulls/comments/92155245","pull_request_review_id":12660088,"id":92155245,"diff_hunk":"@@ -0,0 +1,113 @@\n+# -*- coding: utf-8 -*-\n+# © 2009 Jordi Esteve <jesteve@zikzakmedia.com>\n+# © 2012-2014 Ignacio Ibeas <ignacio@acysos.com>\n+# © 2016 Pedro M. Baeza\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3).\n+\n+from openerp import api, exceptions, fields, models, _\n+from openerp.addons.base_iban.base_iban import normalize_iban, validate_iban\n+\n+\n+class ResPartnerBank(models.Model):\n+    _inherit = 'res.partner.bank'\n+\n+    acc_country_id = fields.Many2one(\n+        comodel_name='res.country', related='partner_id.country_id',\n+        string='Bank country', readonly=True,\n+        help='If the country of the bank is Spain, it validates the bank '\n+             'code or IBAN, formatting it accordingly.')\n+\n+    @api.model\n+    def _crc(self, texto):\n+        \"\"\"Calculo el CRC de un número de 10 dígitos\n+        ajustados con ceros por la izquierda\"\"\"\n+        factor = (1, 2, 4, 8, 5, 10, 9, 7, 3, 6)\n+        # Cálculo CRC\n+        nCRC = 0\n+        for n in range(10):\n+            nCRC += int(texto[n]) * factor[n]\n+        # Reducción del CRC a un dígi9to\n+        nValor = 11 - nCRC % 11\n+        if nValor == 10:\n+            nValor = 1\n+        elif nValor == 11:\n+            nValor = 0\n+        return nValor\n+\n+    @api.model\n+    def _calc_cc(self, banco, sucursal, cuenta):\n+        \"\"\"Cálculo del código de control bancario\"\"\"\n+        texto = \"00%04d%04d\" % (int(banco), int(sucursal))\n+        dc1 = self._crc(texto)\n+        texto = \"%010d\" % long(cuenta)\n+        dc2 = self._crc(texto)\n+        return \"%1d%1d\" % (dc1, dc2)\n+\n+    @api.model\n+    def check_bank_account(self, account):\n+        number = \"\"\n+        for i in account:\n+            if i.isdigit():\n+                number += i\n+        if len(number) != 20:","path":"l10n_es_partner/models/res_partner_bank.py","position":52,"original_position":52,"commit_id":"aa8ccc041f0dca183a6c35dc930984799604d3ae","original_commit_id":"aa8ccc041f0dca183a6c35dc930984799604d3ae","user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"body":"Este chequeo debería omitirse si la cuenta no es española.","created_at":"2016-12-13T12:04:57Z","updated_at":"2016-12-13T12:10:32Z","html_url":"https://github.com/OCA/l10n-spain/pull/410#discussion_r92155245","pull_request_url":"https://api.github.com/repos/OCA/l10n-spain/pulls/410","_links":{"self":{"href":"https://api.github.com/repos/OCA/l10n-spain/pulls/comments/92155245"},"html":{"href":"https://github.com/OCA/l10n-spain/pull/410#discussion_r92155245"},"pull_request":{"href":"https://api.github.com/repos/OCA/l10n-spain/pulls/410"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/l10n-spain/pulls/410","id":97407805,"html_url":"https://github.com/OCA/l10n-spain/pull/410","diff_url":"https://github.com/OCA/l10n-spain/pull/410.diff","patch_url":"https://github.com/OCA/l10n-spain/pull/410.patch","issue_url":"https://api.github.com/repos/OCA/l10n-spain/issues/410","number":410,"state":"open","locked":false,"title":"[9.0][MIG] l10n_es_partner","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":"cc @Tecnativa","created_at":"2016-12-10T01:39:45Z","updated_at":"2016-12-13T12:10:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6db73a68a35fb4fe00ebafc9b0cf4976fa419813","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OCA/l10n-spain/pulls/410/commits","review_comments_url":"https://api.github.com/repos/OCA/l10n-spain/pulls/410/comments","review_comment_url":"https://api.github.com/repos/OCA/l10n-spain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/l10n-spain/issues/410/comments","statuses_url":"https://api.github.com/repos/OCA/l10n-spain/statuses/aa8ccc041f0dca183a6c35dc930984799604d3ae","head":{"label":"Tecnativa:9.0-l10n_es_partner","ref":"9.0-l10n_es_partner","sha":"aa8ccc041f0dca183a6c35dc930984799604d3ae","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":59427800,"name":"l10n-spain","full_name":"Tecnativa/l10n-spain","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/l10n-spain","description":"Odoo Spain Localization","fork":true,"url":"https://api.github.com/repos/Tecnativa/l10n-spain","forks_url":"https://api.github.com/repos/Tecnativa/l10n-spain/forks","keys_url":"https://api.github.com/repos/Tecnativa/l10n-spain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tecnativa/l10n-spain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tecnativa/l10n-spain/teams","hooks_url":"https://api.github.com/repos/Tecnativa/l10n-spain/hooks","issue_events_url":"https://api.github.com/repos/Tecnativa/l10n-spain/issues/events{/number}","events_url":"https://api.github.com/repos/Tecnativa/l10n-spain/events","assignees_url":"https://api.github.com/repos/Tecnativa/l10n-spain/assignees{/user}","branches_url":"https://api.github.com/repos/Tecnativa/l10n-spain/branches{/branch}","tags_url":"https://api.github.com/repos/Tecnativa/l10n-spain/tags","blobs_url":"https://api.github.com/repos/Tecnativa/l10n-spain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tecnativa/l10n-spain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tecnativa/l10n-spain/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tecnativa/l10n-spain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tecnativa/l10n-spain/statuses/{sha}","languages_url":"https://api.github.com/repos/Tecnativa/l10n-spain/languages","stargazers_url":"https://api.github.com/repos/Tecnativa/l10n-spain/stargazers","contributors_url":"https://api.github.com/repos/Tecnativa/l10n-spain/contributors","subscribers_url":"https://api.github.com/repos/Tecnativa/l10n-spain/subscribers","subscription_url":"https://api.github.com/repos/Tecnativa/l10n-spain/subscription","commits_url":"https://api.github.com/repos/Tecnativa/l10n-spain/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tecnativa/l10n-spain/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tecnativa/l10n-spain/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tecnativa/l10n-spain/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tecnativa/l10n-spain/contents/{+path}","compare_url":"https://api.github.com/repos/Tecnativa/l10n-spain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tecnativa/l10n-spain/merges","archive_url":"https://api.github.com/repos/Tecnativa/l10n-spain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tecnativa/l10n-spain/downloads","issues_url":"https://api.github.com/repos/Tecnativa/l10n-spain/issues{/number}","pulls_url":"https://api.github.com/repos/Tecnativa/l10n-spain/pulls{/number}","milestones_url":"https://api.github.com/repos/Tecnativa/l10n-spain/milestones{/number}","notifications_url":"https://api.github.com/repos/Tecnativa/l10n-spain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tecnativa/l10n-spain/labels{/name}","releases_url":"https://api.github.com/repos/Tecnativa/l10n-spain/releases{/id}","deployments_url":"https://api.github.com/repos/Tecnativa/l10n-spain/deployments","created_at":"2016-05-22T18:28:19Z","updated_at":"2016-05-22T18:28:21Z","pushed_at":"2016-12-10T01:56:06Z","git_url":"git://github.com/Tecnativa/l10n-spain.git","ssh_url":"git@github.com:Tecnativa/l10n-spain.git","clone_url":"https://github.com/Tecnativa/l10n-spain.git","svn_url":"https://github.com/Tecnativa/l10n-spain","homepage":"http://odoospain.odoo.com","size":27787,"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":"d399fc206b494f03ed0ceaf2f0caaff7173b327f","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":20920616,"name":"l10n-spain","full_name":"OCA/l10n-spain","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/l10n-spain","description":"Odoo Spain Localization","fork":false,"url":"https://api.github.com/repos/OCA/l10n-spain","forks_url":"https://api.github.com/repos/OCA/l10n-spain/forks","keys_url":"https://api.github.com/repos/OCA/l10n-spain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/l10n-spain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/l10n-spain/teams","hooks_url":"https://api.github.com/repos/OCA/l10n-spain/hooks","issue_events_url":"https://api.github.com/repos/OCA/l10n-spain/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/l10n-spain/events","assignees_url":"https://api.github.com/repos/OCA/l10n-spain/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/l10n-spain/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/l10n-spain/tags","blobs_url":"https://api.github.com/repos/OCA/l10n-spain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/l10n-spain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/l10n-spain/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/l10n-spain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/l10n-spain/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/l10n-spain/languages","stargazers_url":"https://api.github.com/repos/OCA/l10n-spain/stargazers","contributors_url":"https://api.github.com/repos/OCA/l10n-spain/contributors","subscribers_url":"https://api.github.com/repos/OCA/l10n-spain/subscribers","subscription_url":"https://api.github.com/repos/OCA/l10n-spain/subscription","commits_url":"https://api.github.com/repos/OCA/l10n-spain/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/l10n-spain/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/l10n-spain/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/l10n-spain/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/l10n-spain/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/l10n-spain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/l10n-spain/merges","archive_url":"https://api.github.com/repos/OCA/l10n-spain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/l10n-spain/downloads","issues_url":"https://api.github.com/repos/OCA/l10n-spain/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/l10n-spain/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/l10n-spain/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/l10n-spain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/l10n-spain/labels{/name}","releases_url":"https://api.github.com/repos/OCA/l10n-spain/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/l10n-spain/deployments","created_at":"2014-06-17T11:21:27Z","updated_at":"2016-11-24T21:59:43Z","pushed_at":"2016-12-10T03:35:39Z","git_url":"git://github.com/OCA/l10n-spain.git","ssh_url":"git@github.com:OCA/l10n-spain.git","clone_url":"https://github.com/OCA/l10n-spain.git","svn_url":"https://github.com/OCA/l10n-spain","homepage":"http://odoospain.odoo.com","size":57548,"stargazers_count":48,"watchers_count":48,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":26,"forks":134,"open_issues":26,"watchers":48,"default_branch":"10.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/l10n-spain/pulls/410"},"html":{"href":"https://github.com/OCA/l10n-spain/pull/410"},"issue":{"href":"https://api.github.com/repos/OCA/l10n-spain/issues/410"},"comments":{"href":"https://api.github.com/repos/OCA/l10n-spain/issues/410/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/l10n-spain/pulls/410/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/l10n-spain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/l10n-spain/pulls/410/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/l10n-spain/statuses/aa8ccc041f0dca183a6c35dc930984799604d3ae"}}}}
{"actor":{"display_login":"Yajo"}}