{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/event/pulls/comments/44218557","id":44218557,"diff_hunk":"@@ -0,0 +1,151 @@\n+# -*- coding: utf-8 -*-\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\n+# © 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis\n+\n+from openerp import _, api, fields, models\n+from .common import M\n+from .. import exceptions as ex\n+\n+\n+class ActionType(models.Model):\n+    \"\"\"Types of training actions.\n+\n+    Depending on the training action type, a training action may expect some\n+    type of hours. For example:\n+\n+    - If a training action's type is \"on-site\", it expects on-site hours.\n+    - If its type is \"online\", it expects online hours.\n+    - If its type is \"mixed\", it expects both on-site and online hours.\n+\n+    You can configure it as you wish.\n+    \"\"\"\n+    _name = M % \"action_type\"\n+    _sql_constraints = [(\"unique_name\",\n+                         \"UNIQUE(name)\",\n+                         \"Name must be unique.\")]\n+\n+    name = fields.Char(required=True, index=True, translate=True)\n+    action_ids = fields.One2many(\n+        M % \"action\",\n+        \"type_id\",\n+        \"Training actions\",\n+        help=\"Training actions of this type.\")\n+    expected_duration_type_ids = fields.Many2many(\n+        M % \"duration_type\",\n+        string=\"Expected hour types\",\n+        help=\"These types of hours are expected in this type of training \"\n+             \"action. For example, a training of type 'mixed' may expect \"\n+             \"hours of types 'on-site' and 'online'.\")\n+\n+\n+class Action(models.Model):\n+    \"\"\"Define training actions.\n+\n+    A training action is one course that your company teaches and has in its\n+    catalog of courses.\n+\n+    They define some requirements that the corresponding event is expected to\n+    fulfill. Events linked to training actions are considered training groups.\n+    \"\"\"\n+    _name = M % \"action\"\n+\n+    name = fields.Char(required=True, index=True, translate=True)\n+    type_id = fields.Many2one(\n+        M % \"action_type\",\n+        \"Training type\",\n+        required=True)\n+    contents = fields.Html(\n+        translatable=True,\n+        help=\"Contents of the course, shown in the rear side of the diploma.\")\n+    append_template = fields.Selection(","path":"training/models/training_action.py","position":60,"original_position":60,"commit_id":"7d08685b3a7a3bcacff72399438ff33472b37059","original_commit_id":"7d08685b3a7a3bcacff72399438ff33472b37059","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":"`certificate_template` would be more appropriate","created_at":"2015-11-07T23:24:04Z","updated_at":"2015-11-07T23:24:04Z","html_url":"https://github.com/OCA/event/pull/14#discussion_r44218557","pull_request_url":"https://api.github.com/repos/OCA/event/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/OCA/event/pulls/comments/44218557"},"html":{"href":"https://github.com/OCA/event/pull/14#discussion_r44218557"},"pull_request":{"href":"https://api.github.com/repos/OCA/event/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/event/pulls/14","id":49948210,"html_url":"https://github.com/OCA/event/pull/14","diff_url":"https://github.com/OCA/event/pull/14.diff","patch_url":"https://github.com/OCA/event/pull/14.patch","issue_url":"https://api.github.com/repos/OCA/event/issues/14","number":14,"state":"open","locked":false,"title":"Training","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":"Relaunch first split module from https://github.com/OCA/event/pull/13. Target: https://github.com/OCA/l10n-spain/issues/174. CC @dreispt @pedrobaeza.\r\n\r\nTraining\r\n========\r\n\r\nThis module was written to extend the functionality of events to support\r\ntrainings and allow you to manage training actions, training groups,\r\ntraining hour types, training materials, etc.","created_at":"2015-11-06T12:30:11Z","updated_at":"2015-11-07T23:24:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98e64d3f3b01944b5c24aaa66b4885a25a52aa65","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/event/pulls/14/commits","review_comments_url":"https://api.github.com/repos/OCA/event/pulls/14/comments","review_comment_url":"https://api.github.com/repos/OCA/event/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/event/issues/14/comments","statuses_url":"https://api.github.com/repos/OCA/event/statuses/7d08685b3a7a3bcacff72399438ff33472b37059","head":{"label":"grupoesoc:training","ref":"training","sha":"7d08685b3a7a3bcacff72399438ff33472b37059","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-06T12:33:41Z","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":449,"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":"6b6ecdf55faa21c4cdc934b362c7b24ef9355456","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-06T12:34:30Z","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":517,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":9,"forks":7,"open_issues":9,"watchers":1,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/event/pulls/14"},"html":{"href":"https://github.com/OCA/event/pull/14"},"issue":{"href":"https://api.github.com/repos/OCA/event/issues/14"},"comments":{"href":"https://api.github.com/repos/OCA/event/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/event/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/event/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/event/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/event/statuses/7d08685b3a7a3bcacff72399438ff33472b37059"}}}}