diff --git a/project_task_timer/README.rst b/project_task_timer/README.rst new file mode 100644 index 000000000..19e68f20a --- /dev/null +++ b/project_task_timer/README.rst @@ -0,0 +1,21 @@ +Project Task Timer v14 +====================== +Task Timer with Start & Stop + +Installation +============ + - www.odoo.com/documentation/13.0/setup/install.html + - Install our custom addon + +Configuration +============= + + No additional configurations needed + +Credits +======= + Developer: Jesni Banu v10 @ cybrosys, Contact: odoo@cybrosys.com + Kavya Raveendran v11 @ cybrosys, Contact: odoo@cybrosys.com + Kavya Raveendran v12 @ cybrosys, Contact: odoo@cybrosys.com + Sreejith sasidharan v13 @ cybrosys, Contact: odoo@cybrosys.com + Minhaj T v14 @ cybrosys, Contact: odoo@cybrosys.com diff --git a/project_task_timer/__init__.py b/project_task_timer/__init__.py new file mode 100644 index 000000000..1eefcb23a --- /dev/null +++ b/project_task_timer/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from . import models diff --git a/project_task_timer/__manifest__.py b/project_task_timer/__manifest__.py new file mode 100644 index 000000000..e7088ff21 --- /dev/null +++ b/project_task_timer/__manifest__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Project Task Timer', + 'version': '14.0.1.0.0', + 'summary': """Task Timer With Start & Stop""", + 'description': """"This module helps you to track time sheet in project automatically.""", + 'category': 'Project', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'depends': ['base', 'project', 'hr_timesheet'], + 'data': [ + 'views/project_task_timer_view.xml', + 'views/project_timer_static.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'demo': [], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/project_task_timer/doc/RELEASE_NOTES.md b/project_task_timer/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..71ec84c4f --- /dev/null +++ b/project_task_timer/doc/RELEASE_NOTES.md @@ -0,0 +1,4 @@ +## Module + +#### 03.10.2020 +#### Version 14.0.1.0.0 diff --git a/project_task_timer/models/__init__.py b/project_task_timer/models/__init__.py new file mode 100644 index 000000000..3d840b3d5 --- /dev/null +++ b/project_task_timer/models/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from . import project_task_timer diff --git a/project_task_timer/models/project_task_timer.py b/project_task_timer/models/project_task_timer.py new file mode 100644 index 000000000..67af1784c --- /dev/null +++ b/project_task_timer/models/project_task_timer.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Jesni Banu() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from datetime import datetime +from odoo import models, fields, api + + +class ProjectTaskTimeSheet(models.Model): + _inherit = 'account.analytic.line' + + date_start = fields.Datetime(string='Start Date') + date_end = fields.Datetime(string='End Date', readonly=1) + timer_duration = fields.Float(invisible=1, string='Time Duration (Minutes)') + + +class ProjectTaskTimer(models.Model): + _inherit = 'project.task' + + task_timer = fields.Boolean(string='Timer', default=False) + is_user_working = fields.Boolean( + 'Is Current User Working', compute='_compute_is_user_working', + help="Technical field indicating whether the current user is working. ") + duration = fields.Float( + 'Real Duration', compute='_compute_duration', store=True) + + def _compute_duration(self): + self + + def _compute_is_user_working(self): + """ Checks whether the current user is working """ + for order in self: + if order.timesheet_ids.filtered(lambda x: (x.user_id.id == self.env.user.id) and (not x.date_end)): + order.is_user_working = True + else: + order.is_user_working = False + + @api.model + @api.constrains('task_timer') + def toggle_start(self): + if self.task_timer is True: + self.write({'is_user_working': True}) + time_line = self.env['account.analytic.line'] + for time_sheet in self: + time_line.create({ + 'name': self.env.user.name + ': ' + time_sheet.name, + 'task_id': time_sheet.id, + 'user_id': self.env.user.id, + 'project_id': time_sheet.project_id.id, + 'date_start': datetime.now(), + }) + else: + self.write({'is_user_working': False}) + time_line_obj = self.env['account.analytic.line'] + domain = [('task_id', 'in', self.ids), ('date_end', '=', False)] + for time_line in time_line_obj.search(domain): + time_line.write({'date_end': fields.Datetime.now()}) + if time_line.date_end: + diff = fields.Datetime.from_string(time_line.date_end) - fields.Datetime.from_string( + time_line.date_start) + time_line.timer_duration = round(diff.total_seconds() / 60.0, 2) + time_line.unit_amount = round(diff.total_seconds() / (60.0 * 60.0), 2) + else: + time_line.unit_amount = 0.0 + time_line.timer_duration = 0.0 + + + + diff --git a/project_task_timer/static/description/banner.png b/project_task_timer/static/description/banner.png new file mode 100644 index 000000000..b30c46501 Binary files /dev/null and b/project_task_timer/static/description/banner.png differ diff --git a/project_task_timer/static/description/icon.png b/project_task_timer/static/description/icon.png new file mode 100644 index 000000000..8f61ea998 Binary files /dev/null and b/project_task_timer/static/description/icon.png differ diff --git a/project_task_timer/static/description/images/banner_lifeline_for_task.jpeg b/project_task_timer/static/description/images/banner_lifeline_for_task.jpeg new file mode 100644 index 000000000..4a467ea22 Binary files /dev/null and b/project_task_timer/static/description/images/banner_lifeline_for_task.jpeg differ diff --git a/project_task_timer/static/description/images/banner_project_report_xls_pdf.png b/project_task_timer/static/description/images/banner_project_report_xls_pdf.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/project_task_timer/static/description/images/banner_project_report_xls_pdf.png differ diff --git a/project_task_timer/static/description/images/banner_project_status_report.png b/project_task_timer/static/description/images/banner_project_status_report.png new file mode 100644 index 000000000..d1b689710 Binary files /dev/null and b/project_task_timer/static/description/images/banner_project_status_report.png differ diff --git a/project_task_timer/static/description/images/banner_subtask.jpeg b/project_task_timer/static/description/images/banner_subtask.jpeg new file mode 100644 index 000000000..f2b224110 Binary files /dev/null and b/project_task_timer/static/description/images/banner_subtask.jpeg differ diff --git a/project_task_timer/static/description/images/banner_task_deadline_reminder.jpeg b/project_task_timer/static/description/images/banner_task_deadline_reminder.jpeg new file mode 100644 index 000000000..998679818 Binary files /dev/null and b/project_task_timer/static/description/images/banner_task_deadline_reminder.jpeg differ diff --git a/project_task_timer/static/description/images/banner_task_statusbar.jpeg b/project_task_timer/static/description/images/banner_task_statusbar.jpeg new file mode 100644 index 000000000..2c57cbb7b Binary files /dev/null and b/project_task_timer/static/description/images/banner_task_statusbar.jpeg differ diff --git a/project_task_timer/static/description/images/checked.png b/project_task_timer/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/project_task_timer/static/description/images/checked.png differ diff --git a/project_task_timer/static/description/images/cybrosys.png b/project_task_timer/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/project_task_timer/static/description/images/cybrosys.png differ diff --git a/project_task_timer/static/description/images/task_timer.gif b/project_task_timer/static/description/images/task_timer.gif new file mode 100644 index 000000000..ba0a1bd3d Binary files /dev/null and b/project_task_timer/static/description/images/task_timer.gif differ diff --git a/project_task_timer/static/description/images/task_timerV13_1.png b/project_task_timer/static/description/images/task_timerV13_1.png new file mode 100644 index 000000000..50cacc8b8 Binary files /dev/null and b/project_task_timer/static/description/images/task_timerV13_1.png differ diff --git a/project_task_timer/static/description/images/task_timerV13_2.png b/project_task_timer/static/description/images/task_timerV13_2.png new file mode 100644 index 000000000..c123ec5c3 Binary files /dev/null and b/project_task_timer/static/description/images/task_timerV13_2.png differ diff --git a/project_task_timer/static/description/images/task_timerV13_3.png b/project_task_timer/static/description/images/task_timerV13_3.png new file mode 100644 index 000000000..309b7af03 Binary files /dev/null and b/project_task_timer/static/description/images/task_timerV13_3.png differ diff --git a/project_task_timer/static/description/images/task_timer_youtube.png b/project_task_timer/static/description/images/task_timer_youtube.png new file mode 100644 index 000000000..fb6579727 Binary files /dev/null and b/project_task_timer/static/description/images/task_timer_youtube.png differ diff --git a/project_task_timer/static/description/index.html b/project_task_timer/static/description/index.html new file mode 100644 index 000000000..cc77f7adf --- /dev/null +++ b/project_task_timer/static/description/index.html @@ -0,0 +1,308 @@ +
cybrosys-logo
+
+
+
+

Project Task Timer

+

Task Timer with Start & Stop

+
+

Key Highlights

+
    +
  • Timer in Task.
  • +
  • Automatic Timesheet Calculation.
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ You have a toggle button to start & stop your task and record your actual working hours. When you start your task timer, you get a notification, alongside a time sheet entry with starting time that is automatically generated by the timer for that particular task. When you toggle it to stop, the task’s end date shall be updated and the duration gets automatically calculated. +

+
+
+ +

Project Task Timer

+
+
    +

    + Timer in Task. +

    +

    + Notification when starting the Timer. +

    +

    + Automatic Timesheet Calculation. +

    +
+
+ +
+
+

Screenshots

+
+
+
+ +
+
+
+
+
+ +

Video

+
+
+

Project Task Timer Demo

+ +
+ Cybrosys Cover Video +
+
+
+ +
+
    +
+
+
+
+
+
+
+

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/project_task_timer/static/src/js/timer.js b/project_task_timer/static/src/js/timer.js new file mode 100644 index 000000000..263ca45de --- /dev/null +++ b/project_task_timer/static/src/js/timer.js @@ -0,0 +1,70 @@ +odoo.define('project_task_timer.timer', function (require) { +"use strict"; +var AbstractField = require('web.AbstractField'); +var core = require('web.core'); +var field_registry = require('web.field_registry'); +var time = require('web.time'); +var FieldManagerMixin = require('web.FieldManagerMixin'); + +var _t = core._t; + +// $(document).on('click','#timer', function(){ +// if ($(this).hasClass('btn-secondary')) +// { $(this).removeClass('btn-secondary'); +// $(this).addClass('btn-primary'); +// } +// }); + +var TimeCounter = AbstractField.extend({ + + willStart: function () { + var self = this; + var def = this._rpc({ + model: 'account.analytic.line', + method: 'search_read', + domain: [['task_id', '=', this.res_id], ['user_id', '=', self.record.context['uid']]], + }).then(function (result) { + if (self.mode === 'readonly') { + var currentDate = new Date(); + self.duration = 0; + _.each(result, function (data) { + self.duration += data.date_end ? + self._getDateDifference(data.date_start, data.date_end): + self._getDateDifference(time.auto_str_to_date(data.date_start), currentDate); + }); + } + }); + return $.when(this._super.apply(this, arguments), def); + }, + destroy: function () { + this._super.apply(this, arguments); + clearTimeout(this.timer); + }, + isSet: function () { + return true; + }, + _getDateDifference: function (dateStart, dateEnd) { + return moment(dateEnd).diff(moment(dateStart)); + }, + + _render: function () { + this._startTimeCounter(); + }, + _startTimeCounter: function () { + var self = this; + clearTimeout(this.timer); + if (this.record.data.is_user_working) { + this.timer = setTimeout(function () { + self.duration += 1000; + self._startTimeCounter(); + }, 1000); + } else { + clearTimeout(this.timer); + } + this.$el.html($('' + moment.utc(this.duration).format("HH:mm:ss") + '')); + }, +}); +field_registry.add('timesheet_uoms', TimeCounter); +}); + + diff --git a/project_task_timer/views/project_task_timer_view.xml b/project_task_timer/views/project_task_timer_view.xml new file mode 100644 index 000000000..c01021c8e --- /dev/null +++ b/project_task_timer/views/project_task_timer_view.xml @@ -0,0 +1,46 @@ + + + + + project task timer + project.task + + + + + +
+ +
+
+
+
+ + + project task timer1 + project.task + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/project_task_timer/views/project_timer_static.xml b/project_task_timer/views/project_timer_static.xml new file mode 100644 index 000000000..6c3566376 --- /dev/null +++ b/project_task_timer/views/project_timer_static.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file