Browse Source

Apr 25: [ADD] Initial Commit 'pos_timesheet'

pull/254/merge
RisvanaCybro 1 year ago
parent
commit
4f1b262a12
  1. 46
      pos_timesheet/README.rst
  2. 22
      pos_timesheet/__init__.py
  3. 57
      pos_timesheet/__manifest__.py
  4. 7
      pos_timesheet/doc/RELEASE_NOTES.md
  5. 24
      pos_timesheet/models/__init__.py
  6. 29
      pos_timesheet/models/account_analytic_line.py
  7. 35
      pos_timesheet/models/pos_config.py
  8. 93
      pos_timesheet/models/pos_session.py
  9. BIN
      pos_timesheet/static/description/assets/icons/check.png
  10. BIN
      pos_timesheet/static/description/assets/icons/chevron.png
  11. BIN
      pos_timesheet/static/description/assets/icons/cogs.png
  12. BIN
      pos_timesheet/static/description/assets/icons/consultation.png
  13. BIN
      pos_timesheet/static/description/assets/icons/ecom-black.png
  14. BIN
      pos_timesheet/static/description/assets/icons/education-black.png
  15. BIN
      pos_timesheet/static/description/assets/icons/hotel-black.png
  16. BIN
      pos_timesheet/static/description/assets/icons/license.png
  17. BIN
      pos_timesheet/static/description/assets/icons/lifebuoy.png
  18. BIN
      pos_timesheet/static/description/assets/icons/manufacturing-black.png
  19. BIN
      pos_timesheet/static/description/assets/icons/pos-black.png
  20. BIN
      pos_timesheet/static/description/assets/icons/puzzle.png
  21. BIN
      pos_timesheet/static/description/assets/icons/restaurant-black.png
  22. BIN
      pos_timesheet/static/description/assets/icons/service-black.png
  23. BIN
      pos_timesheet/static/description/assets/icons/trading-black.png
  24. BIN
      pos_timesheet/static/description/assets/icons/training.png
  25. BIN
      pos_timesheet/static/description/assets/icons/update.png
  26. BIN
      pos_timesheet/static/description/assets/icons/user.png
  27. BIN
      pos_timesheet/static/description/assets/icons/wrench.png
  28. BIN
      pos_timesheet/static/description/assets/misc/categories.png
  29. BIN
      pos_timesheet/static/description/assets/misc/check-box.png
  30. BIN
      pos_timesheet/static/description/assets/misc/compass.png
  31. BIN
      pos_timesheet/static/description/assets/misc/corporate.png
  32. BIN
      pos_timesheet/static/description/assets/misc/customer-support.png
  33. BIN
      pos_timesheet/static/description/assets/misc/cybrosys-logo.png
  34. BIN
      pos_timesheet/static/description/assets/misc/features.png
  35. BIN
      pos_timesheet/static/description/assets/misc/logo.png
  36. BIN
      pos_timesheet/static/description/assets/misc/pictures.png
  37. BIN
      pos_timesheet/static/description/assets/misc/pie-chart.png
  38. BIN
      pos_timesheet/static/description/assets/misc/right-arrow.png
  39. BIN
      pos_timesheet/static/description/assets/misc/star.png
  40. BIN
      pos_timesheet/static/description/assets/misc/support.png
  41. BIN
      pos_timesheet/static/description/assets/misc/whatsapp.png
  42. BIN
      pos_timesheet/static/description/assets/modules/module_1.png
  43. BIN
      pos_timesheet/static/description/assets/modules/module_2.png
  44. BIN
      pos_timesheet/static/description/assets/modules/module_3.png
  45. BIN
      pos_timesheet/static/description/assets/modules/module_4.png
  46. BIN
      pos_timesheet/static/description/assets/modules/module_5.png
  47. BIN
      pos_timesheet/static/description/assets/modules/module_6.png
  48. BIN
      pos_timesheet/static/description/assets/screenshots/1img.png
  49. BIN
      pos_timesheet/static/description/assets/screenshots/2img.png
  50. BIN
      pos_timesheet/static/description/assets/screenshots/3img.png
  51. BIN
      pos_timesheet/static/description/assets/screenshots/4img.png
  52. BIN
      pos_timesheet/static/description/assets/screenshots/5img.png
  53. BIN
      pos_timesheet/static/description/assets/screenshots/v15-hero.gif
  54. BIN
      pos_timesheet/static/description/banner.png
  55. BIN
      pos_timesheet/static/description/icon.png
  56. 524
      pos_timesheet/static/description/index.html
  57. 12
      pos_timesheet/static/src/css/worked_hour_popup.css
  58. 34
      pos_timesheet/static/src/js/Chrome.js
  59. 15
      pos_timesheet/static/src/js/HeaderLockButton.js
  60. 23
      pos_timesheet/static/src/js/Popups/ClosePosPopup.js
  61. 101
      pos_timesheet/static/src/js/Popups/WorkedHourPopup.js
  62. 163
      pos_timesheet/static/src/js/model.js
  63. 14
      pos_timesheet/static/src/xml/CashMoveButton.xml
  64. 29
      pos_timesheet/static/src/xml/Popups/WorkedHourPopup.xml
  65. 14
      pos_timesheet/static/src/xml/TimeSheetButton.xml
  66. 41
      pos_timesheet/views/pos_config_views.xml
  67. 19
      pos_timesheet/views/pos_session_view.xml

46
pos_timesheet/README.rst

@ -0,0 +1,46 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
POS Timesheet
=============
Efficiently track employees' work hours in POS.
Configuration
=============
No configuration
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
License
-------
General Public License, Version 3 (LGPL v3).
(http://www.gnu.org/licenses/lgpl-3.0-standalone.html)
Credits
-------
Developer: (V15) Mohammed Dilshad Tk , Contact: odoo@cybrosys.com
Contacts
--------
* Mail Contact : odoo@cybrosys.com
* Website : https://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 `Our Website <https://cybrosys.com/>`__
Further information
===================
HTML Description: `<static/description/index.html>`__

22
pos_timesheet/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Mohammed Dilshad Tk (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import models

57
pos_timesheet/__manifest__.py

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Mohammed Dilshad Tk (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
{
'name': 'POS Timesheet',
'version': '15.0.1.0.0',
'category': 'Point of Sale',
'summary': """Efficiently track employees work hours in POS.""",
'description': """This module enhances the Point of Sale (POS)
functionality by automatically calculating timesheet for employees based
on their activities in the POS.""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'depends': ['point_of_sale', 'hr_timesheet', 'project'],
'data': [
'views/pos_config_views.xml',
'views/pos_session_view.xml',
],
'assets': {
'point_of_sale.assets': [
'pos_timesheet/static/src/css/worked_hour_popup.css',
'pos_timesheet/static/src/js/HeaderLockButton.js',
'pos_timesheet/static/src/js/model.js',
'pos_timesheet/static/src/js/Chrome.js',
'pos_timesheet/static/src/js/Popups/ClosePosPopup.js',
'pos_timesheet/static/src/js/Popups/WorkedHourPopup.js',
],
'web.assets_qweb': [
'pos_timesheet/static/src/xml/**/*',
],
},
'images': ['static/description/banner.png'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

7
pos_timesheet/doc/RELEASE_NOTES.md

@ -0,0 +1,7 @@
## Module <pos_timesheet>
#### 09.04.2024
#### Version 15.0.1.0.0
#### ADD
- Initial commit for POS Timesheet

24
pos_timesheet/models/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Mohammed Dilshad Tk (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import account_analytic_line
from . import pos_config
from . import pos_session

29
pos_timesheet/models/account_analytic_line.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Mohammed Dilshad Tk (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import fields, models
class AccountAnalyticLine(models.Model):
"""Inherits the AccountAnalyticLine class for adding field"""
_inherit = 'account.analytic.line'
pos_created = fields.Boolean(help="To filter records created via pos")

35
pos_timesheet/models/pos_config.py

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Mohammed Dilshad Tk (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import fields, models
class PosConfig(models.Model):
"""Inherits the PosConfig class for adding fields"""
_inherit = 'pos.config'
time_log = fields.Boolean(string="Time Log",
help="Track employees timesheet in pos")
project_id = fields.Many2one(
'project.project',
string="Project",
ondelete='cascade',
help="Project for the timesheet")

93
pos_timesheet/models/pos_session.py

@ -0,0 +1,93 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Mohammed Dilshad Tk (odoo@cybrosys.com)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import api, fields, models, _
class PosSession(models.Model):
"""Inherits the PosSession class for adding fields and functions"""
_inherit = 'pos.session'
task_id = fields.Many2one("project.task", string="Task",
help="Session Timesheet Task",
ondelete='cascade')
@api.model_create_multi
def create(self, vals_list):
"""Create Task for add timesheet"""
result = super().create(vals_list)
if result.config_id.module_pos_hr and result.config_id.time_log:
result.task_id = self.env['project.task'].create({
'name': result.name,
'project_id': result.config_id.project_id.id,
'company_id': result.config_id.company_id.id
})
return result
def _loader_params_account_analytic_line(self):
"""Returns loader params for account"""
return {
'search_params': {
'domain': [('task_id', '=', self.task_id.id),
('date', '=', fields.Date.context_today(self))],
'fields': ['employee_id', 'unit_amount'],
},
}
def set_timesheet(self, data):
"""Update Timesheet of the employee"""
for timesheet in data:
if timesheet['workMinutes'] > 0:
hours = timesheet['workMinutes'] / 60
session_id = self.browse(timesheet['sessionId'])
timestamp_seconds = timesheet['checkInTime'] / 1000
date_time = fields.datetime.fromtimestamp(timestamp_seconds)
date_only = date_time.date()
sudo_timesheet = self.env['account.analytic.line'].sudo()
employee_timesheet = sudo_timesheet.search(
[('task_id', '=', session_id.task_id.id),
('date', '=', date_only),
('employee_id', '=', timesheet['cashierId'])], limit=1)
if employee_timesheet:
employee_timesheet.unit_amount += hours
employee_timesheet.pos_created = True
else:
sudo_timesheet.create({
'task_id': session_id.task_id.id,
'account_id': self.config_id.project_id.
analytic_account_id,
'pos_created': True,
'employee_id': timesheet['cashierId'],
'name': session_id.name,
'date': date_only,
'unit_amount': hours
})
return True
def show_time_log(self):
"""Show the task its contained timesheet for the session"""
return {
'name': _('Time Log'),
'type': 'ir.actions.act_window',
'res_model': 'project.task',
'view_mode': 'form',
'res_id': self.task_id.id,
}

BIN
pos_timesheet/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
pos_timesheet/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
pos_timesheet/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
pos_timesheet/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
pos_timesheet/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
pos_timesheet/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
pos_timesheet/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
pos_timesheet/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pos_timesheet/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
pos_timesheet/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
pos_timesheet/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
pos_timesheet/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
pos_timesheet/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
pos_timesheet/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
pos_timesheet/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
pos_timesheet/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
pos_timesheet/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
pos_timesheet/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
pos_timesheet/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
pos_timesheet/static/description/assets/misc/categories.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pos_timesheet/static/description/assets/misc/check-box.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pos_timesheet/static/description/assets/misc/compass.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
pos_timesheet/static/description/assets/misc/corporate.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pos_timesheet/static/description/assets/misc/customer-support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
pos_timesheet/static/description/assets/misc/cybrosys-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
pos_timesheet/static/description/assets/misc/features.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
pos_timesheet/static/description/assets/misc/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
pos_timesheet/static/description/assets/misc/pictures.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
pos_timesheet/static/description/assets/misc/pie-chart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
pos_timesheet/static/description/assets/misc/right-arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

BIN
pos_timesheet/static/description/assets/misc/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
pos_timesheet/static/description/assets/misc/support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
pos_timesheet/static/description/assets/misc/whatsapp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
pos_timesheet/static/description/assets/modules/module_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
pos_timesheet/static/description/assets/modules/module_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
pos_timesheet/static/description/assets/modules/module_3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
pos_timesheet/static/description/assets/modules/module_4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
pos_timesheet/static/description/assets/modules/module_5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
pos_timesheet/static/description/assets/modules/module_6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
pos_timesheet/static/description/assets/screenshots/1img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

BIN
pos_timesheet/static/description/assets/screenshots/2img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
pos_timesheet/static/description/assets/screenshots/3img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
pos_timesheet/static/description/assets/screenshots/4img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
pos_timesheet/static/description/assets/screenshots/5img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
pos_timesheet/static/description/assets/screenshots/v15-hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
pos_timesheet/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
pos_timesheet/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

524
pos_timesheet/static/description/index.html

@ -0,0 +1,524 @@
<div style="background-color: #714B67; height: 810px; width: 100%; padding: 15px; position: relative;">
<!-- TITLE BAR -->
<div class="d-flex align-items-center justify-content-between"
style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;">
<img src="assets/misc/cybrosys-logo.png" width="42" height="42"
style="width: 42px; height: 42px;"/>
<div>
<div
style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
class="mr-2">
<i class="fa fa-check mr-1"></i>Community
</div>
<div
style="color: #875A7B; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
class="mr-2">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
<div
style="color: #017E84; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;"
class="mr-2">
<i class="fa fa-check mr-1"></i>Odoo.sh
</div>
</div>
</div>
<!-- END OF TITLE BAR -->
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<!-- APP HERO -->
<h1 style="color: #FFFFFF; font-weight: bolder; font-size: 50px; text-align: center; margin-top: 50px;">
POS Timesheet
</h1>
<p style="color:#FFFFFF; padding: 8px 15px; text-align: center; font-size: 24px;">Add Timesheet For
POS</p>
<!-- END OF APP HERO -->
<img src="assets/screenshots/v15-hero.gif" class="img-responsive"
style="width: 100%; margin-left: auto; margin-right: auto;"/>
</div>
</div>
</div>
</div>
<!-- NAVIGATION SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px; margin-top: 300px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/compass.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Explore This
Module</h2>
</div>
<div class="row my-4" style="font-family: 'Montserrat', sans-serif;">
<div class="col-sm-12 col-md-6 my-3">
<a href="#overview">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Overview</span>
<span style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">Learn more about this module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#features">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Features</span>
<span style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View
features of this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
<div class="col-sm-12 col-md-6 my-3">
<a href="#screenshots">
<div class="d-flex justify-content-between align-items-center"
style="background-color: #f5f5f5; padding: 30px; width: 100%;">
<div>
<span style="color: #714B67; font-size: 24px; font-weight: 500; display: block;">Screenshots</span>
<span style="color: #714B67; font-size: 16px; font-weight: 400; color:#282F33; display: block;">View
screenshots for this
module</span>
</div>
<img src="assets/misc/right-arrow.png" width="36" height="36"/>
</div>
</a>
</div>
</div>
<!-- END OF NAVIGATION SECTION -->
<!-- OVERVIEW SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="overview">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pie-chart.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Overview
</h2>
</div>
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 py-4">This module enhances the Point of Sale (POS)
functionality by automatically calculating timesheet for employees based
on their activities in the POS.
</div>
</div>
<!-- END OF OVERVIEW SECTION -->
<!-- FEATURES SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="features">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/features.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Features
</h2>
</div>
<div class="row" style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px; line-height: 200%;">
<div class="col-sm-12 col-md-6">
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Add Timesheet for employees based on
their activities in the POS</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Track Employee activity in POS offline mode</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Using Project and Tasks</span>
</div>
<div class="d-flex align-items-center" style="margin-top: 30px; margin-bottom: 30px">
<img src="assets/misc/check-box.png" class="mr-2"/>
<span style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">View worked hours in the POS menu</span>
</div>
</div>
</div>
<!-- END OF FEATURES SECTION -->
<!-- SCREENSHOTS SECTION -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;" id="screenshots">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/pictures.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Screenshots
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Enable Multi Employee
per Session</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">Enable Multi Employee
per Session, then the
Time Log option will be visible in the
Configuration
Settings of POS and you can also set a
project for the timesheet.</p>
<img src="assets/screenshots/1img.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">View total work
hours,
check-in time and time worked
</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">The employee can view
the total work hours,
last check-in time, and time worked since
the last check-in time by clicking the clock
icon in the header.</p>
<img src="assets/screenshots/3img.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">Timelog smart tab</h3>
<p style="font-weight: 400; font-family: 'Montserrat', sans-serif; font-size: 14px;">You can easily navigate
to the task
associated with the session by clicking
timelog smart tab.
</p>
<img src="assets/screenshots/4img.png" class="img-thumbnail">
</div>
<div style="display: block; margin: 30px auto;">
<h3 style="font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold;">You can see all the
employees timesheet in
the task timesheet tab</h3>
<img src="assets/screenshots/5img.png" class="img-thumbnail">
</div>
</div>
</div>
<!-- END OF SCREENSHOTS SECTION -->
<!-- RELATED PRODUCTS -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/categories.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Related
Products
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner" style="padding: 30px;">
<div class="carousel-item" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/dynamic_accounts_report/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/module_1.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/product_brand_purchase/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/module_2.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/sale_product_image/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/module_3.png">
</div>
</a>
</div>
</div>
<div class="carousel-item active" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/odoo_sale_order_line_views/#" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/module_4.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/base_accounting_kit/#" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/module_5.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/hr_payroll_community/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;"
src="assets/modules/module_6.png">
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END OF RELATED PRODUCTS -->
<!-- OUR SERVICES -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/star.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our Services
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Customization</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">Odoo
Support</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire Odoo Developer</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Integration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Migration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Consultancy</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Licensing Consultancy</h6>
</div>
</div>
</div>
<!-- END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/corporate.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Our
Industries
</h2>
</div>
<div class="container my-5">
<div class="row">
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/trading-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure
and
sell your products</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/pos-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy
configuration
and convivial experience</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/education-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for
educational management</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/manufacturing-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and
schedule your operations</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/ecom-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile
friendly,
awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/service-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of
services and invoice</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/restaurant-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or
restaurant methodically</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 0px; padding: 2rem !important; height: 250px !important;">
<img src="assets/icons/hotel-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5 style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An
all-inclusive
hotel management application</p>
</div>
</div>
</div>
</div>
<!-- END OF OUR INDUSTRIES -->
<!-- SUPPORT -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/customer-support.png"/>
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">Support
</h2>
</div>
<div class="container mt-5">
<div class="row">
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4 d-flex justify-content-center align-items-center"
style="background-color: #714B67; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="assets/misc/support.png" height="48" width="48" style="width: 42px; height: 42px;"/>
</div>
<div>
<h4>Need Help?</h4>
<p style="line-height: 100%;">Got questions or need help? Get in touch.</p>
<a href="mailto:odoo@cybrosys.com">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">
odoo@cybrosys.com</p>
</a>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div style="background-color: #F6F8F9; padding: 30px; display: flex; align-items: center;">
<div class="mr-4 d-flex justify-content-center align-items-center"
style="background-color: #2AC44D; display: inline-block; height: 70px; width: 70px; display: flex; align-items: center; justify-content: center;">
<img src="assets/misc/whatsapp.png" height="52" width="52" style="width: 52px; height: 52px;"/>
</div>
<div>
<h4>WhatsApp</h4>
<p style="line-height: 100%;">Say hi to us on WhatsApp!</p>
<a href="https://api.whatsapp.com/send?phone=918606827707">
<p style="font-weight: 400; font-size: 28px; line-height: 80%; color: #714B67;">+91
8606827707</p>
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 my-5 d-flex justify-content-center align-items-center">
<img src="assets/misc/logo.png" width="144" height="31"
style="width:144px; height: 31px; margin-top: 40px;"/>
</div>
</div>
</div>
<!-- END OF SUPPORT -->

12
pos_timesheet/static/src/css/worked_hour_popup.css

@ -0,0 +1,12 @@
.total-worked {
color: #714B67;
font-weight: bold;
}
.current-worked {
color: #017e84;
font-weight: bold;
margin-left: 10px;
}
.checked-in {
color: #5eb937;
}

34
pos_timesheet/static/src/js/Chrome.js

@ -0,0 +1,34 @@
/** @odoo-module **/
import Chrome from "point_of_sale.Chrome";
import Registries from "point_of_sale.Registries";
const { _lt } = require('@web/core/l10n/translation');
const PosTimeSheetChrome = (Chrome) =>
class extends Chrome {
/**
* @override
* Add timesheet in to server when go to backend
*/
async onClickClock(){
await this.showPopup('WorkedHourPopup');
}
async _closePos() {
if (this.env.pos.config.module_pos_hr & this.env.pos.config.time_log) {
return this.env.pos._handleTimesheet(() => super._closePos(...arguments));
} else {
return await super._closePos(...arguments);
}
}
/**
*@override
* Save Worked hours with CheckoutTime and WorkedMinutes in localStorage
* on beforeunload - closing the browser, reloading or going to other page.
*/
_onBeforeUnload() {
super._onBeforeUnload(...arguments);
const timesheetData = this.env.pos.prepareTimesheet();
localStorage.setItem('timesheetData', JSON.stringify(timesheetData));
}
};
Registries.Component.extend(Chrome, PosTimeSheetChrome);

15
pos_timesheet/static/src/js/HeaderLockButton.js

@ -0,0 +1,15 @@
odoo.define('pos_timesheet.PosHeaderLockButton', function(require) {
'use strict';
const HeaderLockButton = require('point_of_sale.HeaderLockButton');
const Registries = require('point_of_sale.Registries');
/** Extends HeaderLockButton to super showLoginScreen function */
const PosHeaderLockButton = HeaderLockButton =>
class extends HeaderLockButton {
async showLoginScreen() {
await this.env.pos._handleTimesheet(this.env.pos.get('cashier'))
super.showLoginScreen()
}
};
Registries.Component.extend(HeaderLockButton, PosHeaderLockButton);
return HeaderLockButton;
});

23
pos_timesheet/static/src/js/Popups/ClosePosPopup.js

@ -0,0 +1,23 @@
/** @odoo-module **/
import ClosePosPopup from "point_of_sale.ClosePosPopup";
import Registries from "point_of_sale.Registries";
const NewClosePosPopup = (ClosePosPopup) =>
class extends ClosePosPopup {
/**
* @override
* Add timesheet in to server when Close Session.
*/
async closeSession() {
if (this.env.pos.config.module_pos_hr & this.env.pos.config.time_log) {
this.env.pos._handleTimesheet(this.env.pos.get('cashier'))
return super.closeSession(...arguments)
} else {
return await super.closeSession(...arguments);
}
}
};
Registries.Component.extend(ClosePosPopup, NewClosePosPopup);

101
pos_timesheet/static/src/js/Popups/WorkedHourPopup.js

@ -0,0 +1,101 @@
odoo.define('point_of_sale.WorkedHourPopup', function(require) {
'use strict';
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
const Registries = require('point_of_sale.Registries');
const { _lt } = require('@web/core/l10n/translation');
class WorkedHourPopup extends AbstractAwaitablePopup {
/**
* @super
* Sets up: SetInterval to show realtime worked time.
*/
setup() {
super.setup(...arguments);
this.state = owl.hooks.useState({
workedTime: '',
totalWorkedTime: ''
})
owl.hooks.onMounted(() => {
this.workedTime();
this.totalWorkedTime();
this.interval = setInterval(()=>{
this.workedTime();
this.totalWorkedTime();
}, 1000);
})
owl.hooks.onWillUnmount(() => {
clearInterval(this.interval);
})
}
/**
* Getter for the check-in time.
* @returns {string} Formatted check-in time.
*/
get checkInTime() {
const timesheetData = JSON.parse(localStorage.getItem('timesheetData'));
const checkInTime = timesheetData ? timesheetData.at(-1)['checkInTime'] : Date.now();
const formattedDate = new Intl.DateTimeFormat('en-US', {
hour: '2-digit',
minute: '2-digit',
hour12: true
}).format(checkInTime);
return formattedDate;
}
/**
* Getter for the current worked time.
* Assign {string} Formatted current worked time in to this.state.workedTime.
*/
workedTime() {
const [hours, minutes, seconds] = this.currentWorkedTime();
this.state.workedTime = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
}
/**
* Getter for the total today's worked time.
* Assign {string} Formatted total worked time in to this.state.totalWorkedTime.
*/
totalWorkedTime() {
let minutes = 0;
const workerData = this.env.pos.workedTime;
const timesheetData = JSON.parse(localStorage.getItem('timesheetData'));
const cashierId = this.env.pos.get_cashier().id;
if (timesheetData) {
const cashierLocalTimesheet = timesheetData.filter(data => data.cashierId === cashierId && data?.workMinutes);
minutes += cashierLocalTimesheet.reduce((sum, data) => sum + data.workMinutes, 0);
}
const cashierData = workerData.find(data => data['cashierId'] === cashierId);
minutes += cashierData ? parseInt(cashierData['minutes']) : 0;
const [currentHours, currentMinutes, seconds] = this.currentWorkedTime();
let hours = currentHours;
minutes += currentMinutes;
const extraHour = Math.floor(minutes / 60);
minutes %= 60;
hours += extraHour;
this.state.totalWorkedTime = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
}
/**
* Retrieves the current worked time.
* @returns {Array} Array containing hours and minutes of current worked time.
*/
currentWorkedTime() {
const timesheetData = JSON.parse(localStorage.getItem('timesheetData'));
const checkInTime = timesheetData ? timesheetData.at(-1)['checkInTime'] : Date.now();
const currentTime = Date.now();
const differenceMs = Math.abs(currentTime - checkInTime);
const hours = Math.floor(differenceMs / (1000 * 60 * 60));
const minutes = Math.floor((differenceMs % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((differenceMs % (1000 * 60)) / 1000);
return [hours, minutes, seconds];
}}
WorkedHourPopup.template = "pos_timesheet.WorkedHourPopup";
WorkedHourPopup.defaultProps = {
cancelText: _lt("Cancel"),
title: _lt("Worked Hours"),
confirmKey: false,
};
Registries.Component.add(WorkedHourPopup);
return WorkedHourPopup;
});

163
pos_timesheet/static/src/js/model.js

@ -0,0 +1,163 @@
odoo.define('pos_timesheet.pos', function(require) {
"use strict";
const models = require('point_of_sale.models');
const { DateTime } = luxon;
var super_pos_model = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
/** @override
* load employees timesheet of this session
*/
after_load_server_data: async function() {
await this._processData();
return super_pos_model.after_load_server_data.apply(this, arguments)
},
_processData: async function() {
var self = this
if (this.config.module_pos_hr && this.config.time_log) {
this.models.push({
model: 'account.analytic.line',
fields: ['name', 'employee_id', 'id', 'unit_amount', 'date', 'task_id', 'pos_created'],
loaded: function(self, analytic_lines) {
self.timesheet = analytic_lines;
},
});
var employee_list = [];
for (const employee in this.employees){
employee_list.push(this.employees[employee].id)
}
var today = DateTime.local().c['day'] + '/' +
DateTime.local().c['month'] + '/' + DateTime.local().c['year']
var fields = ['employee_id', 'id', 'unit_amount',];
var result = await this.env.services.rpc({
model: 'account.analytic.line',
method: 'search_read',
kwargs: {
domain: [['employee_id', 'in', employee_list],
['pos_created', '=', true],
['date', '=', today]],
fields
},
})
this.timesheet = result;
this.workedTime = this.getWorkedTime();
}
},
/** Retrieves worked time data and sets it to the POS instance. */
getWorkedTime: function() {
const datas = this.timesheet;
const workedTime = datas.map(data => ({
'cashierId': data['employee_id'][0],
'minutes': Math.floor(data['unit_amount'] * 60)
}));
return workedTime;
},
/**
* @override
* If the 'Multi Employee persession' and 'Time Log' enabled in POS configuration,
* handles timesheet processing before setting cashier.
* @param {Object} employee - Employee object representing the cashier.
*/
set_cashier: function(employee) {
this.super_set_cashier = super_pos_model.set_cashier.apply(this, arguments);
if (this.config.module_pos_hr && this.config.time_log) {
return this._handleTimesheet(this.get('cashier'));
} else {
return this.super_set_cashier;
}
},
/**
* Handles timesheet processing asynchronously.
* Executes a callback function and handles timesheet operations based on the POS configuration.
* @param {Function} callback - Callback function to execute.
* @param {Object} employee - Employee object representing the cashier or null.
*/
_handleTimesheet: function(employee = null) {
const data = this.prepareTimesheet();
return this.sendTimesheet(data).then(response => {
this.setTimesheet(response, employee);
})
.catch(errData => {
this.setTimesheet(errData, employee);
})
},
/**
* Sets the timesheet data to localStorage.
* @param {Array} timesheetData - Timesheet data to set.
* @param {Object} employee - Employee object representing the cashier.
*/
setTimesheet: function(timesheetData, employee = null) {
if (employee) {
let cashierId;
if (employee.id) {cashierId = employee.id}
else {cashierId = null; }
const cashierData = {
cashierId: cashierId,
checkInTime: Date.now(),
sessionId: this.pos_session.id
};
if (timesheetData) {
timesheetData.push(cashierData);
} else {
timesheetData = [cashierData];
}
}
localStorage.setItem('timesheetData', JSON.stringify(timesheetData));
},
/**
* Sends timesheet data to the server.
* @param {Array} timesheetData - Timesheet data to send.
* @return {null} success or no timesheetData, if error {Object} timesheetData
*/
sendTimesheet: function(timesheetData) {
return new Promise((resolve, reject) => {
if (timesheetData) {
this.env.services.rpc({
model: 'pos.session',
method: 'set_timesheet',
args: [
[], timesheetData
],
}).then(res => {
timesheetData.forEach(data => {
let index = this.workedTime.findIndex(item => item.cashierId === data.cashierId);
if (index !== -1) {
this.workedTime[index].minutes += data.workMinutes;
} else {
this.workedTime.push({
cashierId: data.cashierId,
minutes: data.workMinutes
});
}
});
resolve(null);
})
.catch(err => {
reject(timesheetData);
});
} else {
resolve(null);
}
});
},
/**
* Prepares timesheet data for sending to the server.
* Checks for existing timesheet data in localStorage and adjusts work minutes.
* @returns {Array|null} Prepared timesheet data.
*/
prepareTimesheet: function() {
const timesheetData = JSON.parse(localStorage.getItem('timesheetData'));
if (timesheetData && timesheetData.length != 0) {
if (!timesheetData.at(-1).hasOwnProperty('checkOutTime')) {
timesheetData.at(-1)['checkOutTime'] = Date.now();
const timeDiff = timesheetData.at(-1)['checkOutTime'] - timesheetData.at(-1)['checkInTime'];
timesheetData.at(-1)['workMinutes'] = Math.floor(timeDiff / (1000 * 60));
if (timesheetData.at(-1)['workMinutes'] <= 0) {
timesheetData.pop();
}
}
return timesheetData;
}
return null;
},
});
});

14
pos_timesheet/static/src/xml/CashMoveButton.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- Update CashMoveButton -->
<t t-name="Chrome" t-inherit="point_of_sale.CashMoveButton"
t-inherit-mode="extension" owl="1">
<xpath expr="//div" position="replace">
<div class="cash-move-button" t-on-click="onClick">
<i class="fa fa-money" aria-hidden="true"></i>
<span t-if="!env.isMobile" style="padding-left: 10px;">Cash In/Out</span>
</div>
</xpath>
</t>
</templates>

29
pos_timesheet/static/src/xml/Popups/WorkedHourPopup.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- WorkedHourPopup to show worked hour -->
<t t-name="pos_timesheet.WorkedHourPopup" owl="1">
<div role="dialog" class="modal-dialog">
<div class="popup">
<header class="title">
<t t-esc="props.title"/>
</header>
<div class="body">
<p>
<h2 class="total-worked" t-esc="state.totalWorkedTime"/>
<div class="current-wrap">
<span class="me-2">Last checked in
<span
class="checked-in" t-esc="checkInTime"/></span>
<span class="current-worked" t-esc="state.workedTime"/>
</div>
</p>
</div>
<div class="footer">
<div class="button cancel" t-on-click="cancel">
<t t-esc="props.cancelText"/>
</div>
</div>
</div>
</div>
</t>
</templates>

14
pos_timesheet/static/src/xml/TimeSheetButton.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="TimeSheetButton" t-inherit="point_of_sale.Chrome"
t-inherit-mode="extension" owl="1">
<xpath expr="//CashierName" position="after">
<div class="header-button" t-on-click="onClickClock"
t-if="env.pos.config.module_pos_hr and env.pos.config.time_log">
<span>
<i class="fa fa-clock-o" role="img"/>
</span>
</div>
</xpath>
</t>
</templates>

41
pos_timesheet/views/pos_config_views.xml

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Add "Time Log" field into pos.config-->
<record id="pos_config_view_form" model="ir.ui.view">
<field name="name">pos.config.view.form.inherit.pos.timesheet</field>
<field name="model">pos.config</field>
<field name="inherit_id"
ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='iface_orderline_customer_notes']"
position="after">
<div class="col-12 col-lg-6 o_setting_box"
title="When starting a session, it automatically creates a task in the selected project and adds the timesheet of the employees based on their work hours automatically."
attrs="{'invisible': [('module_pos_hr','=',False)]}">
<div class="o_setting_left_pane">
<field name="time_log"
attrs="{'readonly': [('has_active_session','=', True)]}"/>
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Time Log
</span>
<div class="text-muted">
Automatically record employees' work hours in the
timesheet
</div>
<div class="content-group mt16">
<div class="row">
<label for="project_id"
string="Project"
class="col-lg-3 o_light_label"/>
<field name="project_id"
attrs="{'required': [('time_log', '=', True)]}"
domain="[('company_id', '=', company_id)]"/>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

19
pos_timesheet/views/pos_session_view.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="pos_time_log_view_pos_session_form" model="ir.ui.view">
<field name="name">pos.session.view.form.inherit.pos.timesheet</field>
<field name="model">pos.session</field>
<field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
<field name="arch" type="xml">
<!-- Add time log smartTab to view current session task and its timesheet -->
<xpath expr="//button[@name='action_show_payments_list']" position="after">
<field name="task_id" invisible="1"/>
<button name="show_time_log" string="Time Log"
class="oe_stat_button" attrs="{'invisible': [('task_id','=',False)]}"
icon="fa-clock-o"
type="object">
</button>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save