{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/server-tools/pulls/comments/42502173","id":42502173,"diff_hunk":"@@ -0,0 +1,20 @@\n+# -*- coding: utf-8 -*-\n+# (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel\n+# (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden\n+# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html\n+\n+from openerp import models, api\n+\n+\n+class ResUsers(models.Model):\n+    _inherit = \"res.users\"\n+\n+    @api.model\n+    def _signup_create_user(self, values):\n+        res = super(ResUsers, self)._signup_create_user(values)\n+        if isinstance(res, int):\n+            user = self.env['res.users'].browse(res)\n+            account_type = values.get('account_type', False)\n+            if account_type and account_type == 'supplier':","path":"auth_supplier/models/res_users.py","position":18,"original_position":18,"commit_id":"7b9ea47231f82046e46716cca193b3024b0db16d","original_commit_id":"7b9ea47231f82046e46716cca193b3024b0db16d","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":"Shouldn't `account_type` be added as a field to this model?\r\n\r\nAlso, wouldn't it be better to add a `supplier` boolean instead? It could be a reference field to `partner_id.supplier` and the ORM would do the rest by itself, if I'm not wrong.","created_at":"2015-10-20T14:27:21Z","updated_at":"2015-10-20T14:27:21Z","html_url":"https://github.com/OCA/server-tools/pull/277#discussion_r42502173","pull_request_url":"https://api.github.com/repos/OCA/server-tools/pulls/277","_links":{"self":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/comments/42502173"},"html":{"href":"https://github.com/OCA/server-tools/pull/277#discussion_r42502173"},"pull_request":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/277"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/server-tools/pulls/277","id":48193454,"html_url":"https://github.com/OCA/server-tools/pull/277","diff_url":"https://github.com/OCA/server-tools/pull/277.diff","patch_url":"https://github.com/OCA/server-tools/pull/277.patch","issue_url":"https://api.github.com/repos/OCA/server-tools/issues/277","number":277,"state":"open","locked":false,"title":"[ADD][8.0] auth_supplier: New Module.","user":{"login":"sergio-incaser","id":7689807,"avatar_url":"https://avatars.githubusercontent.com/u/7689807?v=3","gravatar_id":"","url":"https://api.github.com/users/sergio-incaser","html_url":"https://github.com/sergio-incaser","followers_url":"https://api.github.com/users/sergio-incaser/followers","following_url":"https://api.github.com/users/sergio-incaser/following{/other_user}","gists_url":"https://api.github.com/users/sergio-incaser/gists{/gist_id}","starred_url":"https://api.github.com/users/sergio-incaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergio-incaser/subscriptions","organizations_url":"https://api.github.com/users/sergio-incaser/orgs","repos_url":"https://api.github.com/users/sergio-incaser/repos","events_url":"https://api.github.com/users/sergio-incaser/events{/privacy}","received_events_url":"https://api.github.com/users/sergio-incaser/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-20T12:28:22Z","updated_at":"2015-10-20T14:27:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0cd765ad8186c5d8c7ae7a756ddbd899892c582d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/server-tools/pulls/277/commits","review_comments_url":"https://api.github.com/repos/OCA/server-tools/pulls/277/comments","review_comment_url":"https://api.github.com/repos/OCA/server-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/server-tools/issues/277/comments","statuses_url":"https://api.github.com/repos/OCA/server-tools/statuses/7b9ea47231f82046e46716cca193b3024b0db16d","head":{"label":"incaser:auth_supplier","ref":"auth_supplier","sha":"7b9ea47231f82046e46716cca193b3024b0db16d","user":{"login":"incaser","id":9299916,"avatar_url":"https://avatars.githubusercontent.com/u/9299916?v=3","gravatar_id":"","url":"https://api.github.com/users/incaser","html_url":"https://github.com/incaser","followers_url":"https://api.github.com/users/incaser/followers","following_url":"https://api.github.com/users/incaser/following{/other_user}","gists_url":"https://api.github.com/users/incaser/gists{/gist_id}","starred_url":"https://api.github.com/users/incaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incaser/subscriptions","organizations_url":"https://api.github.com/users/incaser/orgs","repos_url":"https://api.github.com/users/incaser/repos","events_url":"https://api.github.com/users/incaser/events{/privacy}","received_events_url":"https://api.github.com/users/incaser/received_events","type":"Organization","site_admin":false},"repo":{"id":34060251,"name":"server-tools","full_name":"incaser/server-tools","owner":{"login":"incaser","id":9299916,"avatar_url":"https://avatars.githubusercontent.com/u/9299916?v=3","gravatar_id":"","url":"https://api.github.com/users/incaser","html_url":"https://github.com/incaser","followers_url":"https://api.github.com/users/incaser/followers","following_url":"https://api.github.com/users/incaser/following{/other_user}","gists_url":"https://api.github.com/users/incaser/gists{/gist_id}","starred_url":"https://api.github.com/users/incaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incaser/subscriptions","organizations_url":"https://api.github.com/users/incaser/orgs","repos_url":"https://api.github.com/users/incaser/repos","events_url":"https://api.github.com/users/incaser/events{/privacy}","received_events_url":"https://api.github.com/users/incaser/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/incaser/server-tools","description":"Tools for Odoo Administrators to improve some technical features on Odoo.","fork":true,"url":"https://api.github.com/repos/incaser/server-tools","forks_url":"https://api.github.com/repos/incaser/server-tools/forks","keys_url":"https://api.github.com/repos/incaser/server-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/incaser/server-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/incaser/server-tools/teams","hooks_url":"https://api.github.com/repos/incaser/server-tools/hooks","issue_events_url":"https://api.github.com/repos/incaser/server-tools/issues/events{/number}","events_url":"https://api.github.com/repos/incaser/server-tools/events","assignees_url":"https://api.github.com/repos/incaser/server-tools/assignees{/user}","branches_url":"https://api.github.com/repos/incaser/server-tools/branches{/branch}","tags_url":"https://api.github.com/repos/incaser/server-tools/tags","blobs_url":"https://api.github.com/repos/incaser/server-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/incaser/server-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/incaser/server-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/incaser/server-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/incaser/server-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/incaser/server-tools/languages","stargazers_url":"https://api.github.com/repos/incaser/server-tools/stargazers","contributors_url":"https://api.github.com/repos/incaser/server-tools/contributors","subscribers_url":"https://api.github.com/repos/incaser/server-tools/subscribers","subscription_url":"https://api.github.com/repos/incaser/server-tools/subscription","commits_url":"https://api.github.com/repos/incaser/server-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/incaser/server-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/incaser/server-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/incaser/server-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/incaser/server-tools/contents/{+path}","compare_url":"https://api.github.com/repos/incaser/server-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/incaser/server-tools/merges","archive_url":"https://api.github.com/repos/incaser/server-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/incaser/server-tools/downloads","issues_url":"https://api.github.com/repos/incaser/server-tools/issues{/number}","pulls_url":"https://api.github.com/repos/incaser/server-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/incaser/server-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/incaser/server-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/incaser/server-tools/labels{/name}","releases_url":"https://api.github.com/repos/incaser/server-tools/releases{/id}","created_at":"2015-04-16T14:21:26Z","updated_at":"2015-04-29T17:05:08Z","pushed_at":"2015-10-20T12:27:26Z","git_url":"git://github.com/incaser/server-tools.git","ssh_url":"git@github.com:incaser/server-tools.git","clone_url":"https://github.com/incaser/server-tools.git","svn_url":"https://github.com/incaser/server-tools","homepage":"https://community.odoo.com/project/30","size":1720,"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":"f8c3953ee7b6d599fdce398591905f1eb6f65794","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":20896532,"name":"server-tools","full_name":"OCA/server-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/server-tools","description":"Tools for Odoo Administrators to improve some technical features on Odoo.","fork":false,"url":"https://api.github.com/repos/OCA/server-tools","forks_url":"https://api.github.com/repos/OCA/server-tools/forks","keys_url":"https://api.github.com/repos/OCA/server-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/server-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/server-tools/teams","hooks_url":"https://api.github.com/repos/OCA/server-tools/hooks","issue_events_url":"https://api.github.com/repos/OCA/server-tools/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/server-tools/events","assignees_url":"https://api.github.com/repos/OCA/server-tools/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/server-tools/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/server-tools/tags","blobs_url":"https://api.github.com/repos/OCA/server-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/server-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/server-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/server-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/server-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/server-tools/languages","stargazers_url":"https://api.github.com/repos/OCA/server-tools/stargazers","contributors_url":"https://api.github.com/repos/OCA/server-tools/contributors","subscribers_url":"https://api.github.com/repos/OCA/server-tools/subscribers","subscription_url":"https://api.github.com/repos/OCA/server-tools/subscription","commits_url":"https://api.github.com/repos/OCA/server-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/server-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/server-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/server-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/server-tools/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/server-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/server-tools/merges","archive_url":"https://api.github.com/repos/OCA/server-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/server-tools/downloads","issues_url":"https://api.github.com/repos/OCA/server-tools/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/server-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/server-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/server-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/server-tools/labels{/name}","releases_url":"https://api.github.com/repos/OCA/server-tools/releases{/id}","created_at":"2014-06-16T18:52:44Z","updated_at":"2015-10-19T18:55:56Z","pushed_at":"2015-10-20T13:52:19Z","git_url":"git://github.com/OCA/server-tools.git","ssh_url":"git@github.com:OCA/server-tools.git","clone_url":"https://github.com/OCA/server-tools.git","svn_url":"https://github.com/OCA/server-tools","homepage":"https://community.odoo.com/project/30","size":8840,"stargazers_count":71,"watchers_count":71,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":70,"forks":194,"open_issues":70,"watchers":71,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/277"},"html":{"href":"https://github.com/OCA/server-tools/pull/277"},"issue":{"href":"https://api.github.com/repos/OCA/server-tools/issues/277"},"comments":{"href":"https://api.github.com/repos/OCA/server-tools/issues/277/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/277/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/277/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/server-tools/statuses/7b9ea47231f82046e46716cca193b3024b0db16d"}}}}