{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/hr-timesheet/pulls/comments/237025252","pull_request_review_id":179223567,"id":237025252,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzAyNTI1Mg==","diff_hunk":"@@ -0,0 +1,363 @@\n+# Copyright 2018 Brainbean Apps (https://brainbeanapps.com)\n+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).\n+\n+import logging\n+from datetime import timedelta\n+\n+from odoo import fields, models, api, _\n+from odoo.exceptions import UserError, ValidationError\n+\n+_logger = logging.getLogger(__name__)\n+\n+\n+class AccountAnalyticLine(models.Model):\n+    _inherit = 'account.analytic.line'\n+    _order = (\n+        'date desc, create_date desc, id desc'\n+    )\n+\n+    create_date = fields.Datetime(\n+        index=True,\n+    )\n+    is_timetracker_running = fields.Boolean(\n+        string='Timetracker Running',\n+        compute='_compute_is_timetracker_running',\n+        store=True,\n+    )\n+    is_timetracked = fields.Boolean(\n+        string='Timetracked Line',\n+        compute='_compute_is_timetracked',\n+        store=True,\n+    )\n+    timetracker_started_at = fields.Datetime(\n+        string='Started At',\n+        copy=False,\n+        index=True,\n+        help='Timestamp when timetracker was started',\n+    )\n+    timetracker_stopped_at = fields.Datetime(\n+        string='Stopped At',\n+        copy=False,\n+        index=True,\n+        help='Timestamp when timetracker was stopped',\n+    )\n+    can_use_timetracker = fields.Boolean(\n+        string='Can Track Time',\n+        compute='_compute_can_use_timetracker',\n+        default=True,\n+    )\n+\n+    _sql_constraints = [\n+        (\n+            'single_running_timetracker_per_employee',\n+            (\n+                'EXCLUDE (employee_id WITH =) WHERE ('\n+                '    timetracker_started_at IS NOT NULL'\n+                '    AND timetracker_stopped_at IS NULL'\n+                ')'\n+            ),\n+            'Only one running timetracker allowed per employee'\n+        ),\n+    ]\n+\n+    @api.depends('timetracker_started_at', 'timetracker_stopped_at')\n+    def _compute_is_timetracker_running(self):\n+        for line in self:","path":"hr_timesheet_timetracker/models/account_analytic_line.py","position":65,"original_position":65,"commit_id":"e026bdb1e79f4d1400396de4911bd102b6bf2301","original_commit_id":"e026bdb1e79f4d1400396de4911bd102b6bf2301","user":{"login":"alexey-pelykh","id":345102,"node_id":"MDQ6VXNlcjM0NTEwMg==","avatar_url":"https://avatars0.githubusercontent.com/u/345102?v=4","gravatar_id":"","url":"https://api.github.com/users/alexey-pelykh","html_url":"https://github.com/alexey-pelykh","followers_url":"https://api.github.com/users/alexey-pelykh/followers","following_url":"https://api.github.com/users/alexey-pelykh/following{/other_user}","gists_url":"https://api.github.com/users/alexey-pelykh/gists{/gist_id}","starred_url":"https://api.github.com/users/alexey-pelykh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexey-pelykh/subscriptions","organizations_url":"https://api.github.com/users/alexey-pelykh/orgs","repos_url":"https://api.github.com/users/alexey-pelykh/repos","events_url":"https://api.github.com/users/alexey-pelykh/events{/privacy}","received_events_url":"https://api.github.com/users/alexey-pelykh/received_events","type":"User","site_admin":false},"body":"thanks for constructive feedback!","created_at":"2018-11-28T10:32:08Z","updated_at":"2018-11-28T10:32:09Z","html_url":"https://github.com/OCA/hr-timesheet/pull/139#discussion_r237025252","pull_request_url":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/OCA/hr-timesheet/pulls/comments/237025252"},"html":{"href":"https://github.com/OCA/hr-timesheet/pull/139#discussion_r237025252"},"pull_request":{"href":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139"}},"in_reply_to_id":236992646},"pull_request":{"url":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139","id":230445702,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNDQ1NzAy","html_url":"https://github.com/OCA/hr-timesheet/pull/139","diff_url":"https://github.com/OCA/hr-timesheet/pull/139.diff","patch_url":"https://github.com/OCA/hr-timesheet/pull/139.patch","issue_url":"https://api.github.com/repos/OCA/hr-timesheet/issues/139","number":139,"state":"open","locked":false,"title":"[12.0][ADD] hr_timesheet_timetracker: track time spent","user":{"login":"alexey-pelykh","id":345102,"node_id":"MDQ6VXNlcjM0NTEwMg==","avatar_url":"https://avatars0.githubusercontent.com/u/345102?v=4","gravatar_id":"","url":"https://api.github.com/users/alexey-pelykh","html_url":"https://github.com/alexey-pelykh","followers_url":"https://api.github.com/users/alexey-pelykh/followers","following_url":"https://api.github.com/users/alexey-pelykh/following{/other_user}","gists_url":"https://api.github.com/users/alexey-pelykh/gists{/gist_id}","starred_url":"https://api.github.com/users/alexey-pelykh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexey-pelykh/subscriptions","organizations_url":"https://api.github.com/users/alexey-pelykh/orgs","repos_url":"https://api.github.com/users/alexey-pelykh/repos","events_url":"https://api.github.com/users/alexey-pelykh/events{/privacy}","received_events_url":"https://api.github.com/users/alexey-pelykh/received_events","type":"User","site_admin":false},"body":"![image](https://user-images.githubusercontent.com/345102/48503198-28879c00-e84a-11e8-8e1e-b78835f8da8c.png)\r\n![image](https://user-images.githubusercontent.com/345102/48503209-2f161380-e84a-11e8-9383-0df1bc4ae998.png)\r\n![image](https://user-images.githubusercontent.com/345102/48507313-422de100-e854-11e8-87aa-ab872d78ad8c.png)\r\n","created_at":"2018-11-13T11:46:58Z","updated_at":"2018-11-28T10:32:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9047a11610d15b9c3f66611ae10d8b628ff4ff2f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139/commits","review_comments_url":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139/comments","review_comment_url":"https://api.github.com/repos/OCA/hr-timesheet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/hr-timesheet/issues/139/comments","statuses_url":"https://api.github.com/repos/OCA/hr-timesheet/statuses/e026bdb1e79f4d1400396de4911bd102b6bf2301","head":{"label":"brainbeanapps:12.0-add-hr_timesheet_timetracker","ref":"12.0-add-hr_timesheet_timetracker","sha":"e026bdb1e79f4d1400396de4911bd102b6bf2301","user":{"login":"brainbeanapps","id":14878004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODc4MDA0","avatar_url":"https://avatars1.githubusercontent.com/u/14878004?v=4","gravatar_id":"","url":"https://api.github.com/users/brainbeanapps","html_url":"https://github.com/brainbeanapps","followers_url":"https://api.github.com/users/brainbeanapps/followers","following_url":"https://api.github.com/users/brainbeanapps/following{/other_user}","gists_url":"https://api.github.com/users/brainbeanapps/gists{/gist_id}","starred_url":"https://api.github.com/users/brainbeanapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brainbeanapps/subscriptions","organizations_url":"https://api.github.com/users/brainbeanapps/orgs","repos_url":"https://api.github.com/users/brainbeanapps/repos","events_url":"https://api.github.com/users/brainbeanapps/events{/privacy}","received_events_url":"https://api.github.com/users/brainbeanapps/received_events","type":"Organization","site_admin":false},"repo":{"id":156813299,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY4MTMyOTk=","name":"hr-timesheet","full_name":"brainbeanapps/hr-timesheet","private":false,"owner":{"login":"brainbeanapps","id":14878004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODc4MDA0","avatar_url":"https://avatars1.githubusercontent.com/u/14878004?v=4","gravatar_id":"","url":"https://api.github.com/users/brainbeanapps","html_url":"https://github.com/brainbeanapps","followers_url":"https://api.github.com/users/brainbeanapps/followers","following_url":"https://api.github.com/users/brainbeanapps/following{/other_user}","gists_url":"https://api.github.com/users/brainbeanapps/gists{/gist_id}","starred_url":"https://api.github.com/users/brainbeanapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brainbeanapps/subscriptions","organizations_url":"https://api.github.com/users/brainbeanapps/orgs","repos_url":"https://api.github.com/users/brainbeanapps/repos","events_url":"https://api.github.com/users/brainbeanapps/events{/privacy}","received_events_url":"https://api.github.com/users/brainbeanapps/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/brainbeanapps/hr-timesheet","description":"Odoo Timesheet Management Addons","fork":true,"url":"https://api.github.com/repos/brainbeanapps/hr-timesheet","forks_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/forks","keys_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/teams","hooks_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/hooks","issue_events_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/issues/events{/number}","events_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/events","assignees_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/assignees{/user}","branches_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/branches{/branch}","tags_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/tags","blobs_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/git/refs{/sha}","trees_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/statuses/{sha}","languages_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/languages","stargazers_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/stargazers","contributors_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/contributors","subscribers_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/subscribers","subscription_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/subscription","commits_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/commits{/sha}","git_commits_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/git/commits{/sha}","comments_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/comments{/number}","issue_comment_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/issues/comments{/number}","contents_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/contents/{+path}","compare_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/merges","archive_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/downloads","issues_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/issues{/number}","pulls_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/pulls{/number}","milestones_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/milestones{/number}","notifications_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/labels{/name}","releases_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/releases{/id}","deployments_url":"https://api.github.com/repos/brainbeanapps/hr-timesheet/deployments","created_at":"2018-11-09T05:10:35Z","updated_at":"2018-11-09T05:10:38Z","pushed_at":"2018-11-28T10:11:37Z","git_url":"git://github.com/brainbeanapps/hr-timesheet.git","ssh_url":"git@github.com:brainbeanapps/hr-timesheet.git","clone_url":"https://github.com/brainbeanapps/hr-timesheet.git","svn_url":"https://github.com/brainbeanapps/hr-timesheet","homepage":"","size":989,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"11.0"}},"base":{"label":"OCA:12.0","ref":"12.0","sha":"64b5d7b37bb1f72f61ed1bb6a61c64cfcf972631","user":{"login":"OCA","id":7600578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MDA1Nzg=","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":20891557,"node_id":"MDEwOlJlcG9zaXRvcnkyMDg5MTU1Nw==","name":"hr-timesheet","full_name":"OCA/hr-timesheet","private":false,"owner":{"login":"OCA","id":7600578,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2MDA1Nzg=","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},"html_url":"https://github.com/OCA/hr-timesheet","description":"Odoo Timesheet Management Addons","fork":false,"url":"https://api.github.com/repos/OCA/hr-timesheet","forks_url":"https://api.github.com/repos/OCA/hr-timesheet/forks","keys_url":"https://api.github.com/repos/OCA/hr-timesheet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/hr-timesheet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/hr-timesheet/teams","hooks_url":"https://api.github.com/repos/OCA/hr-timesheet/hooks","issue_events_url":"https://api.github.com/repos/OCA/hr-timesheet/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/hr-timesheet/events","assignees_url":"https://api.github.com/repos/OCA/hr-timesheet/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/hr-timesheet/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/hr-timesheet/tags","blobs_url":"https://api.github.com/repos/OCA/hr-timesheet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/hr-timesheet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/hr-timesheet/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/hr-timesheet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/hr-timesheet/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/hr-timesheet/languages","stargazers_url":"https://api.github.com/repos/OCA/hr-timesheet/stargazers","contributors_url":"https://api.github.com/repos/OCA/hr-timesheet/contributors","subscribers_url":"https://api.github.com/repos/OCA/hr-timesheet/subscribers","subscription_url":"https://api.github.com/repos/OCA/hr-timesheet/subscription","commits_url":"https://api.github.com/repos/OCA/hr-timesheet/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/hr-timesheet/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/hr-timesheet/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/hr-timesheet/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/hr-timesheet/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/hr-timesheet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/hr-timesheet/merges","archive_url":"https://api.github.com/repos/OCA/hr-timesheet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/hr-timesheet/downloads","issues_url":"https://api.github.com/repos/OCA/hr-timesheet/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/hr-timesheet/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/hr-timesheet/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/hr-timesheet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/hr-timesheet/labels{/name}","releases_url":"https://api.github.com/repos/OCA/hr-timesheet/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/hr-timesheet/deployments","created_at":"2014-06-16T16:14:01Z","updated_at":"2018-11-07T15:42:29Z","pushed_at":"2018-11-28T10:24:20Z","git_url":"git://github.com/OCA/hr-timesheet.git","ssh_url":"git@github.com:OCA/hr-timesheet.git","clone_url":"https://github.com/OCA/hr-timesheet.git","svn_url":"https://github.com/OCA/hr-timesheet","homepage":"","size":961,"stargazers_count":36,"watchers_count":36,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":113,"mirror_url":null,"archived":false,"open_issues_count":19,"license":null,"forks":113,"open_issues":19,"watchers":36,"default_branch":"11.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139"},"html":{"href":"https://github.com/OCA/hr-timesheet/pull/139"},"issue":{"href":"https://api.github.com/repos/OCA/hr-timesheet/issues/139"},"comments":{"href":"https://api.github.com/repos/OCA/hr-timesheet/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/hr-timesheet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/hr-timesheet/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/hr-timesheet/statuses/e026bdb1e79f4d1400396de4911bd102b6bf2301"}},"author_association":"NONE"}}
{"actor":{"display_login":"alexey-pelykh"}}