{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/project-agile/pulls/comments/170420059","pull_request_review_id":99111297,"id":170420059,"diff_hunk":"@@ -0,0 +1,84 @@\n+# Copyright 2017 - 2018 Modoolar <info@modoolar.com>\n+# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).\n+\n+from odoo import models, fields, api\n+from datetime import datetime\n+\n+\n+class ProjectAnalyticLine(models.Model):\n+    _name = 'project.agile.analytic.line'\n+    _description = \"Project Analytic Line\"\n+    _rec_name = \"task_id\"\n+\n+    task_id = fields.Many2one(\n+        comodel_name='project.task',\n+        string='Task',\n+        required=True,\n+        index=True,\n+        ondelete=\"cascade\",\n+    )\n+\n+    type_id = fields.Many2one(\n+        comodel_name='project.task.type2',\n+        related='task_id.type_id',\n+        string='Type',\n+        readonly=True,\n+        store=True,\n+    )\n+\n+    project_id = fields.Many2one(\n+        comodel_name='project.project',\n+        related='task_id.project_id',\n+        string='Project',\n+        index=True,\n+        store=True,\n+        readonly=True,\n+    )\n+\n+    stage_id = fields.Many2one(\n+        comodel_name='project.task.type',\n+        string='Stage',\n+        required=False,\n+        index=True,\n+    )\n+\n+    user_id = fields.Many2one(\n+        comodel_name='res.users',\n+        string='Assignee',\n+        required=False,\n+        index=True,\n+    )\n+\n+    start_date = fields.Datetime(\n+        string='Start Date',\n+        required=True,\n+        index=True,\n+    )\n+\n+    end_date = fields.Datetime(\n+        string='End Date',\n+        index=True,\n+    )\n+\n+    duration = fields.Float(\n+        string='Duration in hours',\n+        compute=\"_compute_duration\",\n+    )\n+\n+    company_id = fields.Many2one(\n+        comodel_name='res.company',\n+        string='Company',\n+        required=True,\n+        index=True,\n+    )\n+\n+    @api.multi\n+    def _compute_duration(self):\n+        for record in self:\n+            s = fields.Datetime.from_string(record.start_date)\n+            e = record.end_date and \\\n+                fields.Datetime.from_string(record.end_date) or datetime.now()\n+\n+            delta = e - s\n+            hours = delta.total_seconds() / 36000","path":"project_agile_analytic/models/analytic_line.py","position":83,"original_position":83,"commit_id":"d95937b8f4d8aa649fcd986bef820115be7d5c2e","original_commit_id":"d95937b8f4d8aa649fcd986bef820115be7d5c2e","user":{"login":"elicoidal","id":7600613,"avatar_url":"https://avatars0.githubusercontent.com/u/7600613?v=4","gravatar_id":"","url":"https://api.github.com/users/elicoidal","html_url":"https://github.com/elicoidal","followers_url":"https://api.github.com/users/elicoidal/followers","following_url":"https://api.github.com/users/elicoidal/following{/other_user}","gists_url":"https://api.github.com/users/elicoidal/gists{/gist_id}","starred_url":"https://api.github.com/users/elicoidal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elicoidal/subscriptions","organizations_url":"https://api.github.com/users/elicoidal/orgs","repos_url":"https://api.github.com/users/elicoidal/repos","events_url":"https://api.github.com/users/elicoidal/events{/privacy}","received_events_url":"https://api.github.com/users/elicoidal/received_events","type":"User","site_admin":false},"body":"36000 or 3600?","created_at":"2018-02-24T12:23:59Z","updated_at":"2018-02-24T12:32:09Z","html_url":"https://github.com/OCA/project-agile/pull/6#discussion_r170420059","pull_request_url":"https://api.github.com/repos/OCA/project-agile/pulls/6","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/OCA/project-agile/pulls/comments/170420059"},"html":{"href":"https://github.com/OCA/project-agile/pull/6#discussion_r170420059"},"pull_request":{"href":"https://api.github.com/repos/OCA/project-agile/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/project-agile/pulls/6","id":171118633,"html_url":"https://github.com/OCA/project-agile/pull/6","diff_url":"https://github.com/OCA/project-agile/pull/6.diff","patch_url":"https://github.com/OCA/project-agile/pull/6.patch","issue_url":"https://api.github.com/repos/OCA/project-agile/issues/6","number":6,"state":"open","locked":false,"title":"[ADD][11.0] Adding module project_agile_analytic","user":{"login":"pnajman-modoolar","id":28532306,"avatar_url":"https://avatars3.githubusercontent.com/u/28532306?v=4","gravatar_id":"","url":"https://api.github.com/users/pnajman-modoolar","html_url":"https://github.com/pnajman-modoolar","followers_url":"https://api.github.com/users/pnajman-modoolar/followers","following_url":"https://api.github.com/users/pnajman-modoolar/following{/other_user}","gists_url":"https://api.github.com/users/pnajman-modoolar/gists{/gist_id}","starred_url":"https://api.github.com/users/pnajman-modoolar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnajman-modoolar/subscriptions","organizations_url":"https://api.github.com/users/pnajman-modoolar/orgs","repos_url":"https://api.github.com/users/pnajman-modoolar/repos","events_url":"https://api.github.com/users/pnajman-modoolar/events{/privacy}","received_events_url":"https://api.github.com/users/pnajman-modoolar/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\nModule ``project_agile_analytic`` brings analytic entries for ``project.task`` and based on those entries we should be able to generate cumulative flow diagrams and other agile reports.\r\n\r\nKind Regards,\r\nPetar","created_at":"2018-02-23T21:18:19Z","updated_at":"2018-02-24T12:32:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5fa5ef3ebda4d92af5483086da75817b8341353","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OCA/project-agile/pulls/6/commits","review_comments_url":"https://api.github.com/repos/OCA/project-agile/pulls/6/comments","review_comment_url":"https://api.github.com/repos/OCA/project-agile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/project-agile/issues/6/comments","statuses_url":"https://api.github.com/repos/OCA/project-agile/statuses/d95937b8f4d8aa649fcd986bef820115be7d5c2e","head":{"label":"pnajman-modoolar:project_agile_analytic","ref":"project_agile_analytic","sha":"d95937b8f4d8aa649fcd986bef820115be7d5c2e","user":{"login":"pnajman-modoolar","id":28532306,"avatar_url":"https://avatars3.githubusercontent.com/u/28532306?v=4","gravatar_id":"","url":"https://api.github.com/users/pnajman-modoolar","html_url":"https://github.com/pnajman-modoolar","followers_url":"https://api.github.com/users/pnajman-modoolar/followers","following_url":"https://api.github.com/users/pnajman-modoolar/following{/other_user}","gists_url":"https://api.github.com/users/pnajman-modoolar/gists{/gist_id}","starred_url":"https://api.github.com/users/pnajman-modoolar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnajman-modoolar/subscriptions","organizations_url":"https://api.github.com/users/pnajman-modoolar/orgs","repos_url":"https://api.github.com/users/pnajman-modoolar/repos","events_url":"https://api.github.com/users/pnajman-modoolar/events{/privacy}","received_events_url":"https://api.github.com/users/pnajman-modoolar/received_events","type":"User","site_admin":false},"repo":{"id":121607320,"name":"project-agile","full_name":"pnajman-modoolar/project-agile","owner":{"login":"pnajman-modoolar","id":28532306,"avatar_url":"https://avatars3.githubusercontent.com/u/28532306?v=4","gravatar_id":"","url":"https://api.github.com/users/pnajman-modoolar","html_url":"https://github.com/pnajman-modoolar","followers_url":"https://api.github.com/users/pnajman-modoolar/followers","following_url":"https://api.github.com/users/pnajman-modoolar/following{/other_user}","gists_url":"https://api.github.com/users/pnajman-modoolar/gists{/gist_id}","starred_url":"https://api.github.com/users/pnajman-modoolar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnajman-modoolar/subscriptions","organizations_url":"https://api.github.com/users/pnajman-modoolar/orgs","repos_url":"https://api.github.com/users/pnajman-modoolar/repos","events_url":"https://api.github.com/users/pnajman-modoolar/events{/privacy}","received_events_url":"https://api.github.com/users/pnajman-modoolar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pnajman-modoolar/project-agile","description":null,"fork":true,"url":"https://api.github.com/repos/pnajman-modoolar/project-agile","forks_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/forks","keys_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/teams","hooks_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/hooks","issue_events_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/issues/events{/number}","events_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/events","assignees_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/assignees{/user}","branches_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/branches{/branch}","tags_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/tags","blobs_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/git/refs{/sha}","trees_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/statuses/{sha}","languages_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/languages","stargazers_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/stargazers","contributors_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/contributors","subscribers_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/subscribers","subscription_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/subscription","commits_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/commits{/sha}","git_commits_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/git/commits{/sha}","comments_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/comments{/number}","issue_comment_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/issues/comments{/number}","contents_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/contents/{+path}","compare_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/merges","archive_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/downloads","issues_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/issues{/number}","pulls_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/pulls{/number}","milestones_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/milestones{/number}","notifications_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/labels{/name}","releases_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/releases{/id}","deployments_url":"https://api.github.com/repos/pnajman-modoolar/project-agile/deployments","created_at":"2018-02-15T08:44:41Z","updated_at":"2017-12-22T14:02:35Z","pushed_at":"2018-02-23T15:42:59Z","git_url":"git://github.com/pnajman-modoolar/project-agile.git","ssh_url":"git@github.com:pnajman-modoolar/project-agile.git","clone_url":"https://github.com/pnajman-modoolar/project-agile.git","svn_url":"https://github.com/pnajman-modoolar/project-agile","homepage":null,"size":2908,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"10.0"}},"base":{"label":"OCA:11.0","ref":"11.0","sha":"a6ce149598a5a86563b110def47aa0df667275a7","user":{"login":"OCA","id":7600578,"avatar_url":"https://avatars1.githubusercontent.com/u/7600578?v=4","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":111382508,"name":"project-agile","full_name":"OCA/project-agile","owner":{"login":"OCA","id":7600578,"avatar_url":"https://avatars1.githubusercontent.com/u/7600578?v=4","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/project-agile","description":null,"fork":false,"url":"https://api.github.com/repos/OCA/project-agile","forks_url":"https://api.github.com/repos/OCA/project-agile/forks","keys_url":"https://api.github.com/repos/OCA/project-agile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/project-agile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/project-agile/teams","hooks_url":"https://api.github.com/repos/OCA/project-agile/hooks","issue_events_url":"https://api.github.com/repos/OCA/project-agile/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/project-agile/events","assignees_url":"https://api.github.com/repos/OCA/project-agile/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/project-agile/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/project-agile/tags","blobs_url":"https://api.github.com/repos/OCA/project-agile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/project-agile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/project-agile/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/project-agile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/project-agile/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/project-agile/languages","stargazers_url":"https://api.github.com/repos/OCA/project-agile/stargazers","contributors_url":"https://api.github.com/repos/OCA/project-agile/contributors","subscribers_url":"https://api.github.com/repos/OCA/project-agile/subscribers","subscription_url":"https://api.github.com/repos/OCA/project-agile/subscription","commits_url":"https://api.github.com/repos/OCA/project-agile/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/project-agile/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/project-agile/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/project-agile/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/project-agile/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/project-agile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/project-agile/merges","archive_url":"https://api.github.com/repos/OCA/project-agile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/project-agile/downloads","issues_url":"https://api.github.com/repos/OCA/project-agile/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/project-agile/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/project-agile/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/project-agile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/project-agile/labels{/name}","releases_url":"https://api.github.com/repos/OCA/project-agile/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/project-agile/deployments","created_at":"2017-11-20T08:29:38Z","updated_at":"2017-12-22T14:02:35Z","pushed_at":"2018-02-23T21:58:56Z","git_url":"git://github.com/OCA/project-agile.git","ssh_url":"git@github.com:OCA/project-agile.git","clone_url":"https://github.com/OCA/project-agile.git","svn_url":"https://github.com/OCA/project-agile","homepage":null,"size":4,"stargazers_count":5,"watchers_count":5,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":7,"open_issues":15,"watchers":5,"default_branch":"10.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/project-agile/pulls/6"},"html":{"href":"https://github.com/OCA/project-agile/pull/6"},"issue":{"href":"https://api.github.com/repos/OCA/project-agile/issues/6"},"comments":{"href":"https://api.github.com/repos/OCA/project-agile/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/project-agile/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/project-agile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/project-agile/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/project-agile/statuses/d95937b8f4d8aa649fcd986bef820115be7d5c2e"}},"author_association":"NONE"}}
{"actor":{"display_login":"elicoidal"}}