diff --git a/easy_timesheet_add/README.rst b/easy_timesheet_add/README.rst new file mode 100755 index 000000000..539e4d3fe --- /dev/null +++ b/easy_timesheet_add/README.rst @@ -0,0 +1,45 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Quick Add Timesheet +========================= +* Easily Add Timesheet Via Systray. + +Configuration +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL V3). +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V16) Mohammed Dilshad Tk, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/easy_timesheet_add/__init__.py b/easy_timesheet_add/__init__.py new file mode 100644 index 000000000..7ccce3662 --- /dev/null +++ b/easy_timesheet_add/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: MOHAMMED DILSHAD TK (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models diff --git a/easy_timesheet_add/__manifest__.py b/easy_timesheet_add/__manifest__.py new file mode 100755 index 000000000..5592efdd2 --- /dev/null +++ b/easy_timesheet_add/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: MOHAMMED DILSHAD TK (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': "Quick Add Timesheet", + 'version': '16.0.1.0.0', + 'category': 'Project', + 'summary': 'Easily Add Timesheet Via Systray', + 'description': """The module helps to add timesheet from systray by + selecting project, task and Contents for timesheet.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['hr_timesheet'], + 'assets': { + 'web.assets_backend': [ + 'easy_timesheet_add/static/src/js/TimesheetSystray.js', + 'easy_timesheet_add/static/src/xml/TimesheetSystray.xml', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/easy_timesheet_add/doc/RELEASE_NOTES.md b/easy_timesheet_add/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..696f24ffc --- /dev/null +++ b/easy_timesheet_add/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 20.04.2024 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for Quick Add Timesheet diff --git a/easy_timesheet_add/models/__init__.py b/easy_timesheet_add/models/__init__.py new file mode 100755 index 000000000..faa8fceb4 --- /dev/null +++ b/easy_timesheet_add/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: MOHAMMED DILSHAD TK (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import account_analytic_line diff --git a/easy_timesheet_add/models/account_analytic_line.py b/easy_timesheet_add/models/account_analytic_line.py new file mode 100755 index 000000000..2fe5dacb9 --- /dev/null +++ b/easy_timesheet_add/models/account_analytic_line.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: MOHAMMED DILSHAD TK (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import fields, models + + +class AccountAnalyticLine(models.Model): + """Inherits account_analytic_line to store timesheet adding via systray""" + _inherit = 'account.analytic.line' + + start_time = fields.Datetime(help="To store start time of timesheet") + end_time = fields.Datetime(help="To store end time of timesheet") + current_state = fields.Selection([('play', 'play'), ('pause', 'pause')], + help="To manage the timesheet adding via " + "systray") + pausing_time = fields.Char(help="To store time on pausing") + is_current = fields.Boolean(help="Check is timesheet completed or not") diff --git a/easy_timesheet_add/static/description/assets/icons/check.png b/easy_timesheet_add/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/check.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/chevron.png b/easy_timesheet_add/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/chevron.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/cogs.png b/easy_timesheet_add/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/cogs.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/consultation.png b/easy_timesheet_add/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/consultation.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/ecom-black.png b/easy_timesheet_add/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/ecom-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/education-black.png b/easy_timesheet_add/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/education-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/hotel-black.png b/easy_timesheet_add/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/hotel-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/license.png b/easy_timesheet_add/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/license.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/lifebuoy.png b/easy_timesheet_add/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/lifebuoy.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/manufacturing-black.png b/easy_timesheet_add/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/manufacturing-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/pos-black.png b/easy_timesheet_add/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/pos-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/puzzle.png b/easy_timesheet_add/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/puzzle.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/restaurant-black.png b/easy_timesheet_add/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/restaurant-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/service-black.png b/easy_timesheet_add/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/service-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/trading-black.png b/easy_timesheet_add/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/trading-black.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/training.png b/easy_timesheet_add/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/training.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/update.png b/easy_timesheet_add/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/update.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/user.png b/easy_timesheet_add/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/user.png differ diff --git a/easy_timesheet_add/static/description/assets/icons/wrench.png b/easy_timesheet_add/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/easy_timesheet_add/static/description/assets/icons/wrench.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/categories.png b/easy_timesheet_add/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/categories.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/check-box.png b/easy_timesheet_add/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/check-box.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/compass.png b/easy_timesheet_add/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/compass.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/corporate.png b/easy_timesheet_add/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/corporate.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/customer-support.png b/easy_timesheet_add/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/customer-support.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/cybrosys-logo.png b/easy_timesheet_add/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/cybrosys-logo.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/features.png b/easy_timesheet_add/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/features.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/logo.png b/easy_timesheet_add/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/logo.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/pictures.png b/easy_timesheet_add/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/pictures.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/pie-chart.png b/easy_timesheet_add/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/pie-chart.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/right-arrow.png b/easy_timesheet_add/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/right-arrow.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/star.png b/easy_timesheet_add/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/star.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/support.png b/easy_timesheet_add/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/support.png differ diff --git a/easy_timesheet_add/static/description/assets/misc/whatsapp.png b/easy_timesheet_add/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/misc/whatsapp.png differ diff --git a/easy_timesheet_add/static/description/assets/modules/1.png b/easy_timesheet_add/static/description/assets/modules/1.png new file mode 100644 index 000000000..5acf9a06a Binary files /dev/null and b/easy_timesheet_add/static/description/assets/modules/1.png differ diff --git a/easy_timesheet_add/static/description/assets/modules/2.png b/easy_timesheet_add/static/description/assets/modules/2.png new file mode 100644 index 000000000..ac5cbdc80 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/modules/2.png differ diff --git a/easy_timesheet_add/static/description/assets/modules/3.png b/easy_timesheet_add/static/description/assets/modules/3.png new file mode 100644 index 000000000..038385e41 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/modules/3.png differ diff --git a/easy_timesheet_add/static/description/assets/modules/4.png b/easy_timesheet_add/static/description/assets/modules/4.png new file mode 100644 index 000000000..bc5648b1a Binary files /dev/null and b/easy_timesheet_add/static/description/assets/modules/4.png differ diff --git a/easy_timesheet_add/static/description/assets/modules/5.png b/easy_timesheet_add/static/description/assets/modules/5.png new file mode 100644 index 000000000..f8aaeb32c Binary files /dev/null and b/easy_timesheet_add/static/description/assets/modules/5.png differ diff --git a/easy_timesheet_add/static/description/assets/modules/6.png b/easy_timesheet_add/static/description/assets/modules/6.png new file mode 100644 index 000000000..81bb12d06 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/modules/6.png differ diff --git a/easy_timesheet_add/static/description/assets/screenshots/1.png b/easy_timesheet_add/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..a7902bef0 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/screenshots/1.png differ diff --git a/easy_timesheet_add/static/description/assets/screenshots/2.png b/easy_timesheet_add/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..c3881324a Binary files /dev/null and b/easy_timesheet_add/static/description/assets/screenshots/2.png differ diff --git a/easy_timesheet_add/static/description/assets/screenshots/3.png b/easy_timesheet_add/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..017583b22 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/screenshots/3.png differ diff --git a/easy_timesheet_add/static/description/assets/screenshots/4.png b/easy_timesheet_add/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..19454883f Binary files /dev/null and b/easy_timesheet_add/static/description/assets/screenshots/4.png differ diff --git a/easy_timesheet_add/static/description/assets/screenshots/5.png b/easy_timesheet_add/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..fb4cc7db9 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/screenshots/5.png differ diff --git a/easy_timesheet_add/static/description/assets/screenshots/6.png b/easy_timesheet_add/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..9e5a2cb34 Binary files /dev/null and b/easy_timesheet_add/static/description/assets/screenshots/6.png differ diff --git a/easy_timesheet_add/static/description/assets/screenshots/hero.gif b/easy_timesheet_add/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..1079623ae Binary files /dev/null and b/easy_timesheet_add/static/description/assets/screenshots/hero.gif differ diff --git a/easy_timesheet_add/static/description/banner.jpg b/easy_timesheet_add/static/description/banner.jpg new file mode 100644 index 000000000..963cc440a Binary files /dev/null and b/easy_timesheet_add/static/description/banner.jpg differ diff --git a/easy_timesheet_add/static/description/icon.png b/easy_timesheet_add/static/description/icon.png new file mode 100644 index 000000000..969868e37 Binary files /dev/null and b/easy_timesheet_add/static/description/icon.png differ diff --git a/easy_timesheet_add/static/description/index.html b/easy_timesheet_add/static/description/index.html new file mode 100644 index 000000000..d9a4ad259 --- /dev/null +++ b/easy_timesheet_add/static/description/index.html @@ -0,0 +1,554 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + +

Quick Add Timesheet

+

A Module For Easily Add Timesheet Via Systray

+ + +
+ +
+
+ +
+

Explore This + Module +

+
+ + + +
+
+ +
+

Overview +

+
+
+
+ The module helps to add timesheet from systray by selecting project, task and Contents for timesheet. +
+
+ + +
+
+ +
+

Features +

+
+
+
+
+ + Access Rights For Adding Timesheet via systray +
+
+ + Set Timer For Adding Timesheet + +
+
+ + PAUSE and RE-START the timer while counting +
+
+
+
+ + Time Won't Loss After Logout or Refresh +
+ + + + +
+
+ +
+

Screenshots +

+
+
+
+
+

Stopwatch icon in systray which helps to add timesheet.

+ +
+
+
+
+

Select project and task

+

Choose project, task and click START button to start the time.

+ +
+
+
+
+
+

Time starts counting

+

The timer begins counting and users can pause it by clicking the "Pause" button.

+ +
+
+
+
+

RE-START after PAUSE

+

Click Start to continue the paused time

+ +
+
+
+
+

Add description

+

After completing the task, please add a description of the task, then click STOP.

+ +
+
+
+
+

Timesheet created

+

Timesheet will be created for selected project and task with given description

+ +
+
+ + + +
+
+ +
+

Related + Products +

+
+
+
+ +
+
+ + +
+
+ +
+

Our Services +

+
+
+
+
+
+ +
+
+ Odoo + Customization +
+
+
+
+ +
+
+ Odoo + Implementation +
+
+
+
+ +
+
+ Odoo + Support +
+
+
+
+ +
+
+ Hire + Odoo + Developer +
+
+
+
+ +
+
+ Odoo + Integration +
+
+
+
+ +
+
+ Odoo + Migration +
+
+
+
+ +
+
+ Odoo + Consultancy +
+
+
+
+ +
+
+ Odoo + Implementation +
+
+
+
+ +
+
+ Odoo + Licensing Consultancy +
+
+
+
+ + +
+
+ +
+

Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products +

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience +

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management +

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations +

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages +

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice +

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically +

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application +

+
+
+
+
+ + +
+
+ +
+

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com +

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707 +

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/easy_timesheet_add/static/src/img/stopwatch.png b/easy_timesheet_add/static/src/img/stopwatch.png new file mode 100644 index 000000000..fad77e9e2 Binary files /dev/null and b/easy_timesheet_add/static/src/img/stopwatch.png differ diff --git a/easy_timesheet_add/static/src/js/TimesheetSystray.js b/easy_timesheet_add/static/src/js/TimesheetSystray.js new file mode 100644 index 000000000..cae0ce657 --- /dev/null +++ b/easy_timesheet_add/static/src/js/TimesheetSystray.js @@ -0,0 +1,182 @@ +/** @odoo-module **/ +import { registry } from "@web/core/registry"; +import { Component, useState, useRef, onWillStart } from "@odoo/owl"; +import { Dropdown } from "@web/core/dropdown/dropdown"; +import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; +import { formatFloatTime } from "@web/views/fields/formatters"; +import { FloatTimeField } from "@web/views/fields/float_time/float_time_field"; +/** @extends Component to add methods of timesheet view */ +export class TimesheetSystray extends Component { + async setup() { + this.orm = useService("orm"); + this.notification = useService("notification") + this.timesheet = useRef("Timesheet") + this.state = useState({ + project: [], + task: [], + start: false, + WorkTime: null, + timer: false, + Project: 0, + Task: 0, + time: '', + paused: null, + pausedTime: null, + distance: null, + current_task : [], + Access : null + }) + if (await this.env.services.user.hasGroup('hr_timesheet.group_hr_timesheet_user') || + await this.env.services.user.hasGroup('hr_timesheet.group_hr_timesheet_approver') || + await this.env.services.user.hasGroup('hr_timesheet.group_timesheet_manager')) { + this.state.Access = true + this.SearchReadTimeSheet() + this.state.project = await this.orm.searchRead('project.project', []) + this.state.Task = await this.orm.searchRead('project.task', []) + }else{this.state.Access = false} + } + currentDT(){ + const currentDT = new Date(); + const year = currentDT.getFullYear().toString().padStart(4, '0'); + const month = String(currentDT.getMonth() + 1).padStart(2, '0'); //Months are zero-indexed. so,add 1 + const day = currentDT.getDate().toString().padStart(2, '0'); + const hours = currentDT.getHours().toString().padStart(2, '0'); + const minutes = currentDT.getMinutes().toString().padStart(2, '0'); + const seconds = currentDT.getSeconds().toString().padStart(2, '0'); + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; + } + async SearchReadTimeSheet(){ + this.user = await this.orm.searchRead('res.users', + [["id", "=", this.env.services.user.userId]]) + this.state.current_task = await this.orm.searchRead('account.analytic.line', + [["employee_id", "=", this.user[0].employee_id[0]], + ['is_current', '=', true]]) + if(this.state.current_task[0]){ + if(this.state.current_task[0]['end_time']){ + if(this.state.current_task[0]['current_state'] == 'pause'){ + var datetime = new Date(new Date().getTime()) + this.state.time = this.state.current_task[0]['pausing_time'] + this.state.paused = true; + this.state.WorkTime = true + }else{ + this.state.WorkTime = true + this.state.time = this.state.current_task[0]['pausing_time'] + const newDate = new Date() + const timeParts = this.state.time.split(/[hms\s]+/); + this.state.paused = false; + newDate.setHours(newDate.getHours() - parseInt(timeParts[0])); + newDate.setMinutes(newDate.getMinutes() - parseInt(timeParts[1])); + newDate.setSeconds(newDate.getSeconds() - parseInt(timeParts[2])); + this.StartCountTime(new Date(newDate).getTime()) + } + }else{ + this.current_time = new Date(this.state.current_task[0]['start_time']) + this.state.WorkTime = true + this.StartCountTime(this.current_time.getTime()) + } + }else{ + return + } + } + /** Start counting the time **/ + async StartTime() { + this.SearchReadTimeSheet() + this.MainDiv = this.timesheet.el + if (!this.MainDiv.querySelector(".Project").value || + !this.MainDiv.querySelector(".Task").value) { + return this.notification.add(_t("Choose Project and Task"), { type:'warning'}) + } + this.state.start = true; + this.state.WorkTime = true; + this.state.time = this.MainDiv.querySelector(".time").innerHTML; + this.state.Project = this.MainDiv.querySelector(".Project").value + this.state.Task = this.MainDiv.querySelector(".Task").value + this.state.timer = new Date().getTime() + await this.orm.create("account.analytic.line", [{ + project_id: parseInt(this.state.Project), + task_id: parseInt(this.state.Task), + start_time: await this.currentDT(), + name: " ", + is_current: true + }]); + this.SearchReadTimeSheet() + window.location.reload(); + } + /** Pause the time and store the time **/ + async PauseTime(){ + await this.orm.write("account.analytic.line", [this.state.current_task[0].id], { + end_time: await this.currentDT(), + pausing_time: this.state.time, + current_state: 'pause' + }) + await clearInterval(this.StopWatch); + this.state.paused = true; + this.SearchReadTimeSheet(); + window.location.reload(); + } + /** Start after pause and change the state **/ + async PlayTime() { + this.state.pausedTime = this.state.current_task[0].pausing_time + await this.orm.write("account.analytic.line", [this.state.current_task[0].id], { + current_state: 'play' + }) + this.SearchReadTimeSheet() + } + /** Add timesheet based on project, task and time **/ + async AddTimesheet() { + if (!this.timesheet.el.querySelector(".Description").value) { + return this.notification.add(_t("Add a Description"), { type: 'warning'}); + }else { + /** Convert 02h 30m format time => 02:30 and create timesheet**/ + const timeParts = this.state.time.split(/h |m/); + const hours = Number(timeParts[0]); + const minutes = Number(timeParts[1]); + await this.orm.write("account.analytic.line", [this.state.current_task[0].id], { + end_time: await this.currentDT(), + unit_amount: hours + minutes / 60, + name: this.timesheet.el.querySelector(".Description").value, + is_current : false + }) + } + clearInterval(this.StopWatch); + this.state.time = '' + this.state.WorkTime = false; + window.location.reload(); + } + /** Running the count down using setInterval function */ + /** and add the time to state for show in view */ + StartCountTime(start_time) { + var self = this + self.StopWatch = setInterval(async function() { + var currentTime = new Date().getTime() + self.state.distance = currentTime - start_time + var days = Math.floor(self.state.distance / (1000 * 60 * 60 * 24)); + var hours = Math.floor((self.state.distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var minutes = Math.floor((self.state.distance % (1000 * 60 * 60)) / (1000 * 60)); + var seconds = Math.floor((self.state.distance % (1000 * 60)) / 1000); + self.state.time = [hours ? hours + 'h' : '00h', minutes ? minutes + 'm' : '00m', seconds ? seconds + 's' : '00s'].join(' '); + self.orm.write("account.analytic.line", [self.state.current_task[0].id], { + pausing_time: self.state.time + }); + }, 1000); + } + /** Filter the tasks bases on selected project **/ + async ChangeProject(project_id) { + if (project_id){ + this.state.Task = await this.orm.searchRead('project.task', + [["project_id", "=", parseInt(project_id)]]) + } + } + /** Filter the tasks bases on selected project **/ + async ChangeTask(task_id) { + if(task_id){ + var project = await this.orm.searchRead('project.project', [["task_ids", "in", [parseInt(task_id)]]]) + this.timesheet.el.querySelector(".Project").value = project[0].id + } + } +} +TimesheetSystray.template = "TimesheetSystray"; +TimesheetSystray.components = { Dropdown }; +export const systrayItem = { Component: TimesheetSystray, }; +registry.category("systray").add("TimesheetSystray", systrayItem, { sequence: 105 }); diff --git a/easy_timesheet_add/static/src/xml/TimesheetSystray.xml b/easy_timesheet_add/static/src/xml/TimesheetSystray.xml new file mode 100644 index 000000000..9623a87bb --- /dev/null +++ b/easy_timesheet_add/static/src/xml/TimesheetSystray.xml @@ -0,0 +1,84 @@ + +