{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/management-system/pulls/comments/64787023","id":64787023,"diff_hunk":"@@ -0,0 +1,185 @@\n+# -*- coding: utf-8 -*-\n+\n+from openerp import fields, models, api\n+from datetime import datetime, timedelta\n+\n+\n+def own_company(self):\n+    \"\"\"Return the user company id.\"\"\"\n+    return self.env.user.company_id.id\n+\n+\n+def owner(self):\n+    \"\"\"Return the user.\"\"\"\n+    return self.env.user\n+\n+\n+class MgmtSystemAction(models.Model):\n+    \"\"\"Model class that manage action.\"\"\"\n+\n+    _name = \"mgmtsystem.action\"\n+    _description = \"Action\"\n+    # _inherit = \"crm.claim\"\n+    _inherit = \"mail.thread\"\n+\n+    name = fields.Char('Action Subject', required=True)\n+    active = fields.Boolean('Active', default=True)\n+    opening_date = fields.Datetime('Opening Date', readonly=True)\n+    create_date = fields.Datetime('Creation Date', readonly=True)\n+    date_deadline = fields.Date('Deadline')\n+    date_closed = fields.Datetime('Closed', readonly=True)\n+    date = fields.Date('Action Date', default=fields.datetime.now(),\n+                       select=True)\n+    reference = fields.Char('Reference', required=True,\n+                            readonly=True, default=\"NEW\")\n+    user_id = fields.Many2one(\n+        'res.users', 'Responsible', default=owner)\n+    company_id = fields.Many2one('res.company', 'Company')\n+    description = fields.Text('Description')\n+    type_action = fields.Selection(\n+        [\n+            ('immediate', 'Immediate Action'),\n+            ('correction', 'Corrective Action'),\n+            ('prevention', 'Preventive Action'),\n+            ('improvement', 'Improvement Opportunity')\n+        ], 'Response Type')\n+\n+    system_id = fields.Many2one('mgmtsystem.system', 'System')\n+    company_id = fields.Many2one('res.company', 'Company', default=own_company)\n+\n+    stage_id = fields.Many2one(\n+        'mgmtsystem.action.stage',\n+        'Stage',\n+        default=lambda self: self.get_default_stage()\n+    )\n+\n+    @api.model\n+    def get_default_stage(self):","path":"mgmtsystem_action/models/mgmtsystem_action.py","position":57,"original_position":57,"commit_id":"36cb8e6f85fcccd3f1824d530fbbe8021f2fb633","original_commit_id":"36cb8e6f85fcccd3f1824d530fbbe8021f2fb633","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":"Usually this is a private method, with a `_` prefix","created_at":"2016-05-26T17:34:15Z","updated_at":"2016-05-26T17:34:15Z","html_url":"https://github.com/OCA/management-system/pull/115#discussion_r64787023","pull_request_url":"https://api.github.com/repos/OCA/management-system/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/OCA/management-system/pulls/comments/64787023"},"html":{"href":"https://github.com/OCA/management-system/pull/115#discussion_r64787023"},"pull_request":{"href":"https://api.github.com/repos/OCA/management-system/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/management-system/pulls/115","id":52841559,"html_url":"https://github.com/OCA/management-system/pull/115","diff_url":"https://github.com/OCA/management-system/pull/115.diff","patch_url":"https://github.com/OCA/management-system/pull/115.patch","issue_url":"https://api.github.com/repos/OCA/management-system/issues/115","number":115,"state":"open","locked":false,"title":"[9.0] mgmtsystem_action migration","user":{"login":"naousse","id":1227654,"avatar_url":"https://avatars.githubusercontent.com/u/1227654?v=3","gravatar_id":"","url":"https://api.github.com/users/naousse","html_url":"https://github.com/naousse","followers_url":"https://api.github.com/users/naousse/followers","following_url":"https://api.github.com/users/naousse/following{/other_user}","gists_url":"https://api.github.com/users/naousse/gists{/gist_id}","starred_url":"https://api.github.com/users/naousse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naousse/subscriptions","organizations_url":"https://api.github.com/users/naousse/orgs","repos_url":"https://api.github.com/users/naousse/repos","events_url":"https://api.github.com/users/naousse/events{/privacy}","received_events_url":"https://api.github.com/users/naousse/received_events","type":"User","site_admin":false},"body":"#105","created_at":"2015-12-07T13:00:15Z","updated_at":"2016-05-26T17:34:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"862c2ef6d265151ec5721de5c24ecfd0094b608d","assignee":{"login":"max3903","id":939952,"avatar_url":"https://avatars.githubusercontent.com/u/939952?v=3","gravatar_id":"","url":"https://api.github.com/users/max3903","html_url":"https://github.com/max3903","followers_url":"https://api.github.com/users/max3903/followers","following_url":"https://api.github.com/users/max3903/following{/other_user}","gists_url":"https://api.github.com/users/max3903/gists{/gist_id}","starred_url":"https://api.github.com/users/max3903/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3903/subscriptions","organizations_url":"https://api.github.com/users/max3903/orgs","repos_url":"https://api.github.com/users/max3903/repos","events_url":"https://api.github.com/users/max3903/events{/privacy}","received_events_url":"https://api.github.com/users/max3903/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OCA/management-system/milestones/4","html_url":"https://github.com/OCA/management-system/milestones/9.0","labels_url":"https://api.github.com/repos/OCA/management-system/milestones/4/labels","id":1331830,"number":4,"title":"9.0","description":"","creator":{"login":"max3903","id":939952,"avatar_url":"https://avatars.githubusercontent.com/u/939952?v=3","gravatar_id":"","url":"https://api.github.com/users/max3903","html_url":"https://github.com/max3903","followers_url":"https://api.github.com/users/max3903/followers","following_url":"https://api.github.com/users/max3903/following{/other_user}","gists_url":"https://api.github.com/users/max3903/gists{/gist_id}","starred_url":"https://api.github.com/users/max3903/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3903/subscriptions","organizations_url":"https://api.github.com/users/max3903/orgs","repos_url":"https://api.github.com/users/max3903/repos","events_url":"https://api.github.com/users/max3903/events{/privacy}","received_events_url":"https://api.github.com/users/max3903/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":16,"state":"open","created_at":"2015-09-30T18:23:40Z","updated_at":"2016-04-01T22:56:57Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/management-system/pulls/115/commits","review_comments_url":"https://api.github.com/repos/OCA/management-system/pulls/115/comments","review_comment_url":"https://api.github.com/repos/OCA/management-system/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/management-system/issues/115/comments","statuses_url":"https://api.github.com/repos/OCA/management-system/statuses/36cb8e6f85fcccd3f1824d530fbbe8021f2fb633","head":{"label":"naousse:9.0-mgmtsystem_action","ref":"9.0-mgmtsystem_action","sha":"36cb8e6f85fcccd3f1824d530fbbe8021f2fb633","user":{"login":"naousse","id":1227654,"avatar_url":"https://avatars.githubusercontent.com/u/1227654?v=3","gravatar_id":"","url":"https://api.github.com/users/naousse","html_url":"https://github.com/naousse","followers_url":"https://api.github.com/users/naousse/followers","following_url":"https://api.github.com/users/naousse/following{/other_user}","gists_url":"https://api.github.com/users/naousse/gists{/gist_id}","starred_url":"https://api.github.com/users/naousse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naousse/subscriptions","organizations_url":"https://api.github.com/users/naousse/orgs","repos_url":"https://api.github.com/users/naousse/repos","events_url":"https://api.github.com/users/naousse/events{/privacy}","received_events_url":"https://api.github.com/users/naousse/received_events","type":"User","site_admin":false},"repo":{"id":44720976,"name":"management-system","full_name":"naousse/management-system","owner":{"login":"naousse","id":1227654,"avatar_url":"https://avatars.githubusercontent.com/u/1227654?v=3","gravatar_id":"","url":"https://api.github.com/users/naousse","html_url":"https://github.com/naousse","followers_url":"https://api.github.com/users/naousse/followers","following_url":"https://api.github.com/users/naousse/following{/other_user}","gists_url":"https://api.github.com/users/naousse/gists{/gist_id}","starred_url":"https://api.github.com/users/naousse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naousse/subscriptions","organizations_url":"https://api.github.com/users/naousse/orgs","repos_url":"https://api.github.com/users/naousse/repos","events_url":"https://api.github.com/users/naousse/events{/privacy}","received_events_url":"https://api.github.com/users/naousse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/naousse/management-system","description":"Odoo for ISO Management Systems","fork":true,"url":"https://api.github.com/repos/naousse/management-system","forks_url":"https://api.github.com/repos/naousse/management-system/forks","keys_url":"https://api.github.com/repos/naousse/management-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/naousse/management-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/naousse/management-system/teams","hooks_url":"https://api.github.com/repos/naousse/management-system/hooks","issue_events_url":"https://api.github.com/repos/naousse/management-system/issues/events{/number}","events_url":"https://api.github.com/repos/naousse/management-system/events","assignees_url":"https://api.github.com/repos/naousse/management-system/assignees{/user}","branches_url":"https://api.github.com/repos/naousse/management-system/branches{/branch}","tags_url":"https://api.github.com/repos/naousse/management-system/tags","blobs_url":"https://api.github.com/repos/naousse/management-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/naousse/management-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/naousse/management-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/naousse/management-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/naousse/management-system/statuses/{sha}","languages_url":"https://api.github.com/repos/naousse/management-system/languages","stargazers_url":"https://api.github.com/repos/naousse/management-system/stargazers","contributors_url":"https://api.github.com/repos/naousse/management-system/contributors","subscribers_url":"https://api.github.com/repos/naousse/management-system/subscribers","subscription_url":"https://api.github.com/repos/naousse/management-system/subscription","commits_url":"https://api.github.com/repos/naousse/management-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/naousse/management-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/naousse/management-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/naousse/management-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/naousse/management-system/contents/{+path}","compare_url":"https://api.github.com/repos/naousse/management-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/naousse/management-system/merges","archive_url":"https://api.github.com/repos/naousse/management-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/naousse/management-system/downloads","issues_url":"https://api.github.com/repos/naousse/management-system/issues{/number}","pulls_url":"https://api.github.com/repos/naousse/management-system/pulls{/number}","milestones_url":"https://api.github.com/repos/naousse/management-system/milestones{/number}","notifications_url":"https://api.github.com/repos/naousse/management-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/naousse/management-system/labels{/name}","releases_url":"https://api.github.com/repos/naousse/management-system/releases{/id}","deployments_url":"https://api.github.com/repos/naousse/management-system/deployments","created_at":"2015-10-22T03:55:15Z","updated_at":"2015-10-22T03:55:17Z","pushed_at":"2016-05-25T22:42:13Z","git_url":"git://github.com/naousse/management-system.git","ssh_url":"git@github.com:naousse/management-system.git","clone_url":"https://github.com/naousse/management-system.git","svn_url":"https://github.com/naousse/management-system","homepage":"http://odoo-community.org/project/26","size":4026,"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":"09a6fd55780a1187b7506bb38709cc1275c49b5c","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":20894503,"name":"management-system","full_name":"OCA/management-system","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/management-system","description":"Odoo for Management Systems (ISO, IEC, BS)","fork":false,"url":"https://api.github.com/repos/OCA/management-system","forks_url":"https://api.github.com/repos/OCA/management-system/forks","keys_url":"https://api.github.com/repos/OCA/management-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/management-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/management-system/teams","hooks_url":"https://api.github.com/repos/OCA/management-system/hooks","issue_events_url":"https://api.github.com/repos/OCA/management-system/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/management-system/events","assignees_url":"https://api.github.com/repos/OCA/management-system/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/management-system/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/management-system/tags","blobs_url":"https://api.github.com/repos/OCA/management-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/management-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/management-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/management-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/management-system/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/management-system/languages","stargazers_url":"https://api.github.com/repos/OCA/management-system/stargazers","contributors_url":"https://api.github.com/repos/OCA/management-system/contributors","subscribers_url":"https://api.github.com/repos/OCA/management-system/subscribers","subscription_url":"https://api.github.com/repos/OCA/management-system/subscription","commits_url":"https://api.github.com/repos/OCA/management-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/management-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/management-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/management-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/management-system/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/management-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/management-system/merges","archive_url":"https://api.github.com/repos/OCA/management-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/management-system/downloads","issues_url":"https://api.github.com/repos/OCA/management-system/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/management-system/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/management-system/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/management-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/management-system/labels{/name}","releases_url":"https://api.github.com/repos/OCA/management-system/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/management-system/deployments","created_at":"2014-06-16T17:53:24Z","updated_at":"2016-05-09T23:17:01Z","pushed_at":"2016-05-26T15:43:46Z","git_url":"git://github.com/OCA/management-system.git","ssh_url":"git@github.com:OCA/management-system.git","clone_url":"https://github.com/OCA/management-system.git","svn_url":"https://github.com/OCA/management-system","homepage":"http://odoo-community.org/project/26","size":4808,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"open_issues_count":16,"forks":60,"open_issues":16,"watchers":24,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/management-system/pulls/115"},"html":{"href":"https://github.com/OCA/management-system/pull/115"},"issue":{"href":"https://api.github.com/repos/OCA/management-system/issues/115"},"comments":{"href":"https://api.github.com/repos/OCA/management-system/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/management-system/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/management-system/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/management-system/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/management-system/statuses/36cb8e6f85fcccd3f1824d530fbbe8021f2fb633"}}}}
{"actor":{"display_login":"dreispt"}}