{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/event/pulls/comments/46043695","id":46043695,"diff_hunk":"@@ -0,0 +1,33 @@\n+# -*- coding: utf-8 -*-\n+# © 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n+\n+from openerp import _, exceptions\n+\n+\n+class EventProductValidationError(exceptions.ValidationError):\n+    \"\"\"Base class for this module's validation errors.\"\"\"\n+    def __init__(self, *args, **kwargs):\n+        self._args, self._kwargs = args, kwargs\n+        value = self._message()\n+        super(EventProductValidationError, self).__init__(value)\n+\n+    def _message(self):\n+        \"\"\"Format the message.\"\"\"\n+        return self.__doc__.format(*self._args, **self._kwargs)\n+\n+\n+class EventAndTicketError(EventProductValidationError):\n+    __doc__ = _(\"It cannot be a whole event and a ticket at the same time.\")\n+\n+\n+class ProductIsNotEventError(EventProductValidationError):\n+    __doc__ = _(\"Product {} is not for events.\")\n+\n+\n+class ProductEventTypeError(EventProductValidationError):\n+    __doc__ = _(\"Product is already used in some event with a different type.\")\n+\n+\n+class TypeMismatchError(EventProductValidationError):\n+    __doc__ = _(\"Product has type {product_type}, but event has {event_type}.\")","path":"event_product/exceptions.py","position":33,"original_position":33,"commit_id":"1319fc48696237f24f1a02a94dc1bbc11627c510","original_commit_id":"1319fc48696237f24f1a02a94dc1bbc11627c510","user":{"login":"dreispt","id":1246629,"avatar_url":"https://avatars.githubusercontent.com/u/1246629?v=3","gravatar_id":"","url":"https://api.github.com/users/dreispt","html_url":"https://github.com/dreispt","followers_url":"https://api.github.com/users/dreispt/followers","following_url":"https://api.github.com/users/dreispt/following{/other_user}","gists_url":"https://api.github.com/users/dreispt/gists{/gist_id}","starred_url":"https://api.github.com/users/dreispt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreispt/subscriptions","organizations_url":"https://api.github.com/users/dreispt/orgs","repos_url":"https://api.github.com/users/dreispt/repos","events_url":"https://api.github.com/users/dreispt/events{/privacy}","received_events_url":"https://api.github.com/users/dreispt/received_events","type":"User","site_admin":false},"body":"You mean, you about a wrong error message being raised?","created_at":"2015-11-27T12:44:47Z","updated_at":"2015-11-27T12:44:47Z","html_url":"https://github.com/OCA/event/pull/21#discussion_r46043695","pull_request_url":"https://api.github.com/repos/OCA/event/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/OCA/event/pulls/comments/46043695"},"html":{"href":"https://github.com/OCA/event/pull/21#discussion_r46043695"},"pull_request":{"href":"https://api.github.com/repos/OCA/event/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/event/pulls/21","id":51988205,"html_url":"https://github.com/OCA/event/pull/21","diff_url":"https://github.com/OCA/event/pull/21.diff","patch_url":"https://github.com/OCA/event/pull/21.patch","issue_url":"https://api.github.com/repos/OCA/event/issues/21","number":21,"state":"open","locked":false,"title":"[8.0][event_product] New module to combine events and products","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":"Following discussion from #14, and aiming for https://github.com/OCA/l10n-spain/issues/174, this module links events and products.\r\n\r\nThis implementation follows [what was discussed before](https://docs.google.com/document/d/1WiOB1yAWTR2aROpM6O632QWXwgG4hLRUpTHU2Pv4yEQ/edit?usp=sharing), and of course this is the first of a collection of modules to implement training in Odoo.\r\n\r\nSee README for instructions, please.\r\n\r\nCC @pedrobaeza @elicoidal @dreispt @rafaelbn.\r\n\r\nThanks!","created_at":"2015-11-27T12:03:37Z","updated_at":"2015-11-27T12:44:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cb5876b28a4ec92d4f4c3a65019e04c2cbe3e69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/event/pulls/21/commits","review_comments_url":"https://api.github.com/repos/OCA/event/pulls/21/comments","review_comment_url":"https://api.github.com/repos/OCA/event/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/event/issues/21/comments","statuses_url":"https://api.github.com/repos/OCA/event/statuses/1319fc48696237f24f1a02a94dc1bbc11627c510","head":{"label":"grupoesoc:event_product","ref":"event_product","sha":"1319fc48696237f24f1a02a94dc1bbc11627c510","user":{"login":"grupoesoc","id":8087470,"avatar_url":"https://avatars.githubusercontent.com/u/8087470?v=3","gravatar_id":"","url":"https://api.github.com/users/grupoesoc","html_url":"https://github.com/grupoesoc","followers_url":"https://api.github.com/users/grupoesoc/followers","following_url":"https://api.github.com/users/grupoesoc/following{/other_user}","gists_url":"https://api.github.com/users/grupoesoc/gists{/gist_id}","starred_url":"https://api.github.com/users/grupoesoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grupoesoc/subscriptions","organizations_url":"https://api.github.com/users/grupoesoc/orgs","repos_url":"https://api.github.com/users/grupoesoc/repos","events_url":"https://api.github.com/users/grupoesoc/events{/privacy}","received_events_url":"https://api.github.com/users/grupoesoc/received_events","type":"Organization","site_admin":false},"repo":{"id":40473494,"name":"event","full_name":"grupoesoc/event","owner":{"login":"grupoesoc","id":8087470,"avatar_url":"https://avatars.githubusercontent.com/u/8087470?v=3","gravatar_id":"","url":"https://api.github.com/users/grupoesoc","html_url":"https://github.com/grupoesoc","followers_url":"https://api.github.com/users/grupoesoc/followers","following_url":"https://api.github.com/users/grupoesoc/following{/other_user}","gists_url":"https://api.github.com/users/grupoesoc/gists{/gist_id}","starred_url":"https://api.github.com/users/grupoesoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grupoesoc/subscriptions","organizations_url":"https://api.github.com/users/grupoesoc/orgs","repos_url":"https://api.github.com/users/grupoesoc/repos","events_url":"https://api.github.com/users/grupoesoc/events{/privacy}","received_events_url":"https://api.github.com/users/grupoesoc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grupoesoc/event","description":"Event Management addons","fork":true,"url":"https://api.github.com/repos/grupoesoc/event","forks_url":"https://api.github.com/repos/grupoesoc/event/forks","keys_url":"https://api.github.com/repos/grupoesoc/event/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grupoesoc/event/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grupoesoc/event/teams","hooks_url":"https://api.github.com/repos/grupoesoc/event/hooks","issue_events_url":"https://api.github.com/repos/grupoesoc/event/issues/events{/number}","events_url":"https://api.github.com/repos/grupoesoc/event/events","assignees_url":"https://api.github.com/repos/grupoesoc/event/assignees{/user}","branches_url":"https://api.github.com/repos/grupoesoc/event/branches{/branch}","tags_url":"https://api.github.com/repos/grupoesoc/event/tags","blobs_url":"https://api.github.com/repos/grupoesoc/event/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grupoesoc/event/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grupoesoc/event/git/refs{/sha}","trees_url":"https://api.github.com/repos/grupoesoc/event/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grupoesoc/event/statuses/{sha}","languages_url":"https://api.github.com/repos/grupoesoc/event/languages","stargazers_url":"https://api.github.com/repos/grupoesoc/event/stargazers","contributors_url":"https://api.github.com/repos/grupoesoc/event/contributors","subscribers_url":"https://api.github.com/repos/grupoesoc/event/subscribers","subscription_url":"https://api.github.com/repos/grupoesoc/event/subscription","commits_url":"https://api.github.com/repos/grupoesoc/event/commits{/sha}","git_commits_url":"https://api.github.com/repos/grupoesoc/event/git/commits{/sha}","comments_url":"https://api.github.com/repos/grupoesoc/event/comments{/number}","issue_comment_url":"https://api.github.com/repos/grupoesoc/event/issues/comments{/number}","contents_url":"https://api.github.com/repos/grupoesoc/event/contents/{+path}","compare_url":"https://api.github.com/repos/grupoesoc/event/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grupoesoc/event/merges","archive_url":"https://api.github.com/repos/grupoesoc/event/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grupoesoc/event/downloads","issues_url":"https://api.github.com/repos/grupoesoc/event/issues{/number}","pulls_url":"https://api.github.com/repos/grupoesoc/event/pulls{/number}","milestones_url":"https://api.github.com/repos/grupoesoc/event/milestones{/number}","notifications_url":"https://api.github.com/repos/grupoesoc/event/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grupoesoc/event/labels{/name}","releases_url":"https://api.github.com/repos/grupoesoc/event/releases{/id}","created_at":"2015-08-10T09:09:41Z","updated_at":"2015-09-14T10:08:36Z","pushed_at":"2015-11-27T12:09:12Z","git_url":"git://github.com/grupoesoc/event.git","ssh_url":"git@github.com:grupoesoc/event.git","clone_url":"https://github.com/grupoesoc/event.git","svn_url":"https://github.com/grupoesoc/event","homepage":null,"size":331,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"8.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"371599ba5f24081803523138c0373d5ca7e6149d","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":38101394,"name":"event","full_name":"OCA/event","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/event","description":"Event Management addons","fork":false,"url":"https://api.github.com/repos/OCA/event","forks_url":"https://api.github.com/repos/OCA/event/forks","keys_url":"https://api.github.com/repos/OCA/event/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/event/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/event/teams","hooks_url":"https://api.github.com/repos/OCA/event/hooks","issue_events_url":"https://api.github.com/repos/OCA/event/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/event/events","assignees_url":"https://api.github.com/repos/OCA/event/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/event/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/event/tags","blobs_url":"https://api.github.com/repos/OCA/event/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/event/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/event/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/event/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/event/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/event/languages","stargazers_url":"https://api.github.com/repos/OCA/event/stargazers","contributors_url":"https://api.github.com/repos/OCA/event/contributors","subscribers_url":"https://api.github.com/repos/OCA/event/subscribers","subscription_url":"https://api.github.com/repos/OCA/event/subscription","commits_url":"https://api.github.com/repos/OCA/event/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/event/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/event/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/event/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/event/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/event/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/event/merges","archive_url":"https://api.github.com/repos/OCA/event/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/event/downloads","issues_url":"https://api.github.com/repos/OCA/event/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/event/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/event/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/event/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/event/labels{/name}","releases_url":"https://api.github.com/repos/OCA/event/releases{/id}","created_at":"2015-06-26T08:59:06Z","updated_at":"2015-08-21T06:26:26Z","pushed_at":"2015-11-27T12:09:12Z","git_url":"git://github.com/OCA/event.git","ssh_url":"git@github.com:OCA/event.git","clone_url":"https://github.com/OCA/event.git","svn_url":"https://github.com/OCA/event","homepage":null,"size":337,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":7,"forks":8,"open_issues":7,"watchers":1,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/event/pulls/21"},"html":{"href":"https://github.com/OCA/event/pull/21"},"issue":{"href":"https://api.github.com/repos/OCA/event/issues/21"},"comments":{"href":"https://api.github.com/repos/OCA/event/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/event/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/event/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/event/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/event/statuses/1319fc48696237f24f1a02a94dc1bbc11627c510"}}}}