{"action":"created","comment":{"url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/comments/129117661","pull_request_review_id":51858009,"id":129117661,"diff_hunk":"@@ -0,0 +1,29 @@\n+# coding: utf-8\n+# Copyright 2017 Vauxoo (https://www.vauxoo.com) <info@vauxoo.com>\n+# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).\n+\n+from openerp import models, api, fields, _\n+from openerp.exceptions import ValidationError\n+\n+\n+class ResPartner(models.Model):\n+    _inherit = 'res.partner'\n+\n+    vat = fields.Char(copy=False)\n+\n+    @api.constrains('vat', 'country_id')\n+    def _check_vat_uniqueness(self):\n+        \"\"\" Check that the vat is unique in the level\n+            where the partner in the tree\n+        \"\"\"\n+\n+        user_company = self.env.user.company_id\n+\n+        for partner in self:\n+            current_vat = partner.commercial_partner_id.vat\n+            if (user_company.country_id == partner.country_id and","path":"partner_validate_vat/models/res_partner.py","position":null,"original_position":24,"commit_id":"8b5ce9ff68ac01d9ff1348b176633e8fffddaef5","original_commit_id":"2eab893984700c6e8c76602989946aaf2d31828a","user":{"login":"deivislaya","id":5775695,"avatar_url":"https://avatars3.githubusercontent.com/u/5775695?v=4","gravatar_id":"","url":"https://api.github.com/users/deivislaya","html_url":"https://github.com/deivislaya","followers_url":"https://api.github.com/users/deivislaya/followers","following_url":"https://api.github.com/users/deivislaya/following{/other_user}","gists_url":"https://api.github.com/users/deivislaya/gists{/gist_id}","starred_url":"https://api.github.com/users/deivislaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deivislaya/subscriptions","organizations_url":"https://api.github.com/users/deivislaya/orgs","repos_url":"https://api.github.com/users/deivislaya/repos","events_url":"https://api.github.com/users/deivislaya/events{/privacy}","received_events_url":"https://api.github.com/users/deivislaya/received_events","type":"User","site_admin":false},"body":"I try to validate the country of the partner in relation to the user's  country , because it may happen that he places the same vat in another partner located in another country without relation between them. For this case if it is accepted that the same vat is repeated for both partners.  This validation is important when placing the vat in the partner","created_at":"2017-07-24T18:32:29Z","updated_at":"2017-07-24T18:32:29Z","html_url":"https://github.com/Vauxoo/addons-vauxoo/pull/1211#discussion_r129117661","pull_request_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211","_links":{"self":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/comments/129117661"},"html":{"href":"https://github.com/Vauxoo/addons-vauxoo/pull/1211#discussion_r129117661"},"pull_request":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211"}}},"pull_request":{"url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211","id":130481967,"html_url":"https://github.com/Vauxoo/addons-vauxoo/pull/1211","diff_url":"https://github.com/Vauxoo/addons-vauxoo/pull/1211.diff","patch_url":"https://github.com/Vauxoo/addons-vauxoo/pull/1211.patch","issue_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/issues/1211","number":1211,"state":"open","locked":false,"title":"[IMP] partner_validate_vat: Migration to api new","user":{"login":"deivislaya","id":5775695,"avatar_url":"https://avatars3.githubusercontent.com/u/5775695?v=4","gravatar_id":"","url":"https://api.github.com/users/deivislaya","html_url":"https://github.com/deivislaya","followers_url":"https://api.github.com/users/deivislaya/followers","following_url":"https://api.github.com/users/deivislaya/following{/other_user}","gists_url":"https://api.github.com/users/deivislaya/gists{/gist_id}","starred_url":"https://api.github.com/users/deivislaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deivislaya/subscriptions","organizations_url":"https://api.github.com/users/deivislaya/orgs","repos_url":"https://api.github.com/users/deivislaya/repos","events_url":"https://api.github.com/users/deivislaya/events{/privacy}","received_events_url":"https://api.github.com/users/deivislaya/received_events","type":"User","site_admin":false},"body":"vx#8249\n\n**TODO**\n\n- [x] Validate that Partner's VAT must be a unique value in each company","created_at":"2017-07-13T22:34:46Z","updated_at":"2017-07-24T18:32:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8082f6ad8d544efaf7d065250fa583393402fb61","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211/commits","review_comments_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211/comments","review_comment_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/issues/1211/comments","statuses_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/statuses/8b5ce9ff68ac01d9ff1348b176633e8fffddaef5","head":{"label":"vauxoo-dev:8.0-vx#8249-deivis","ref":"8.0-vx#8249-deivis","sha":"8b5ce9ff68ac01d9ff1348b176633e8fffddaef5","user":{"login":"vauxoo-dev","id":7662790,"avatar_url":"https://avatars2.githubusercontent.com/u/7662790?v=4","gravatar_id":"","url":"https://api.github.com/users/vauxoo-dev","html_url":"https://github.com/vauxoo-dev","followers_url":"https://api.github.com/users/vauxoo-dev/followers","following_url":"https://api.github.com/users/vauxoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/vauxoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/vauxoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vauxoo-dev/subscriptions","organizations_url":"https://api.github.com/users/vauxoo-dev/orgs","repos_url":"https://api.github.com/users/vauxoo-dev/repos","events_url":"https://api.github.com/users/vauxoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/vauxoo-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":27313681,"name":"addons-vauxoo","full_name":"vauxoo-dev/addons-vauxoo","owner":{"login":"vauxoo-dev","id":7662790,"avatar_url":"https://avatars2.githubusercontent.com/u/7662790?v=4","gravatar_id":"","url":"https://api.github.com/users/vauxoo-dev","html_url":"https://github.com/vauxoo-dev","followers_url":"https://api.github.com/users/vauxoo-dev/followers","following_url":"https://api.github.com/users/vauxoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/vauxoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/vauxoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vauxoo-dev/subscriptions","organizations_url":"https://api.github.com/users/vauxoo-dev/orgs","repos_url":"https://api.github.com/users/vauxoo-dev/repos","events_url":"https://api.github.com/users/vauxoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/vauxoo-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vauxoo-dev/addons-vauxoo","description":null,"fork":true,"url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo","forks_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/forks","keys_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/teams","hooks_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/hooks","issue_events_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/issues/events{/number}","events_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/events","assignees_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/assignees{/user}","branches_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/branches{/branch}","tags_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/tags","blobs_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/statuses/{sha}","languages_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/languages","stargazers_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/stargazers","contributors_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/contributors","subscribers_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/subscribers","subscription_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/subscription","commits_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/contents/{+path}","compare_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/merges","archive_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/downloads","issues_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/issues{/number}","pulls_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/pulls{/number}","milestones_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/milestones{/number}","notifications_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/labels{/name}","releases_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/releases{/id}","deployments_url":"https://api.github.com/repos/vauxoo-dev/addons-vauxoo/deployments","created_at":"2014-11-29T20:09:46Z","updated_at":"2015-02-14T06:28:38Z","pushed_at":"2017-07-22T18:07:33Z","git_url":"git://github.com/vauxoo-dev/addons-vauxoo.git","ssh_url":"git@github.com:vauxoo-dev/addons-vauxoo.git","clone_url":"https://github.com/vauxoo-dev/addons-vauxoo.git","svn_url":"https://github.com/vauxoo-dev/addons-vauxoo","homepage":"","size":99462,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Vauxoo:8.0","ref":"8.0","sha":"7db5f7cfbbb82e8f970d72ac0a2e84171131b71a","user":{"login":"Vauxoo","id":5997834,"avatar_url":"https://avatars0.githubusercontent.com/u/5997834?v=4","gravatar_id":"","url":"https://api.github.com/users/Vauxoo","html_url":"https://github.com/Vauxoo","followers_url":"https://api.github.com/users/Vauxoo/followers","following_url":"https://api.github.com/users/Vauxoo/following{/other_user}","gists_url":"https://api.github.com/users/Vauxoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Vauxoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vauxoo/subscriptions","organizations_url":"https://api.github.com/users/Vauxoo/orgs","repos_url":"https://api.github.com/users/Vauxoo/repos","events_url":"https://api.github.com/users/Vauxoo/events{/privacy}","received_events_url":"https://api.github.com/users/Vauxoo/received_events","type":"Organization","site_admin":false},"repo":{"id":27311720,"name":"addons-vauxoo","full_name":"Vauxoo/addons-vauxoo","owner":{"login":"Vauxoo","id":5997834,"avatar_url":"https://avatars0.githubusercontent.com/u/5997834?v=4","gravatar_id":"","url":"https://api.github.com/users/Vauxoo","html_url":"https://github.com/Vauxoo","followers_url":"https://api.github.com/users/Vauxoo/followers","following_url":"https://api.github.com/users/Vauxoo/following{/other_user}","gists_url":"https://api.github.com/users/Vauxoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Vauxoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vauxoo/subscriptions","organizations_url":"https://api.github.com/users/Vauxoo/orgs","repos_url":"https://api.github.com/users/Vauxoo/repos","events_url":"https://api.github.com/users/Vauxoo/events{/privacy}","received_events_url":"https://api.github.com/users/Vauxoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Vauxoo/addons-vauxoo","description":"All our modules related to developments that solves generic issues on Odoo, or that solve internal problems on Odoo Core, if something is here, maybe it is solving an issue in your company, try it and report what you see.","fork":false,"url":"https://api.github.com/repos/Vauxoo/addons-vauxoo","forks_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/forks","keys_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/teams","hooks_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/hooks","issue_events_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/issues/events{/number}","events_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/events","assignees_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/assignees{/user}","branches_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/branches{/branch}","tags_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/tags","blobs_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/statuses/{sha}","languages_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/languages","stargazers_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/stargazers","contributors_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/contributors","subscribers_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/subscribers","subscription_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/subscription","commits_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/contents/{+path}","compare_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/merges","archive_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/downloads","issues_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/issues{/number}","pulls_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls{/number}","milestones_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/milestones{/number}","notifications_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/labels{/name}","releases_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/releases{/id}","deployments_url":"https://api.github.com/repos/Vauxoo/addons-vauxoo/deployments","created_at":"2014-11-29T18:51:03Z","updated_at":"2017-07-20T10:42:32Z","pushed_at":"2017-07-22T18:07:34Z","git_url":"git://github.com/Vauxoo/addons-vauxoo.git","ssh_url":"git@github.com:Vauxoo/addons-vauxoo.git","clone_url":"https://github.com/Vauxoo/addons-vauxoo.git","svn_url":"https://github.com/Vauxoo/addons-vauxoo","homepage":"http://www.vauxoo.com","size":98133,"stargazers_count":83,"watchers_count":83,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":183,"mirror_url":null,"open_issues_count":122,"forks":183,"open_issues":122,"watchers":83,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211"},"html":{"href":"https://github.com/Vauxoo/addons-vauxoo/pull/1211"},"issue":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/issues/1211"},"comments":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/issues/1211/comments"},"review_comments":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211/comments"},"review_comment":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/pulls/1211/commits"},"statuses":{"href":"https://api.github.com/repos/Vauxoo/addons-vauxoo/statuses/8b5ce9ff68ac01d9ff1348b176633e8fffddaef5"}}}}
{"actor":{"display_login":"deivislaya"}}