diff --git a/pos_show_clock/README.rst b/pos_show_clock/README.rst new file mode 100644 index 0000000000..ece53f69f5 --- /dev/null +++ b/pos_show_clock/README.rst @@ -0,0 +1,110 @@ +============== +Pos Show Clock +============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:0e70fbebfa69a64123199748ecd552d91aebb6ca7c9364b9176638264924b0c1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/18.0/pos_show_clock + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_show_clock + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of Point of Sale (point_of_sale) +to display the current time on the main screen. + +|image1| + +.. |image1| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_show_clock/static/description/printscreen.png + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* KMEE + +Contributors +------------ + +- `KMEE `__: + + - Luis Felipe Mileo + - Ygor Carvalho + - Felipe Zago + +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +Other credits +------------- + +The development of this module has been financially supported by: + +- `KMEE `__ + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-mileo| image:: https://github.com/mileo.png?size=40px + :target: https://github.com/mileo + :alt: mileo +.. |maintainer-ygcarvalh| image:: https://github.com/ygcarvalh.png?size=40px + :target: https://github.com/ygcarvalh + :alt: ygcarvalh +.. |maintainer-felipezago| image:: https://github.com/felipezago.png?size=40px + :target: https://github.com/felipezago + :alt: felipezago + +Current `maintainers `__: + +|maintainer-mileo| |maintainer-ygcarvalh| |maintainer-felipezago| + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_show_clock/__init__.py b/pos_show_clock/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_show_clock/__manifest__.py b/pos_show_clock/__manifest__.py new file mode 100644 index 0000000000..2fd079302b --- /dev/null +++ b/pos_show_clock/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2021 KMEE +# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl). + +{ + "name": "Pos Show Clock", + "summary": """Point of Sale: Display Current Date and Time on POS sreen""", + "version": "18.0.1.0.0", + "author": "KMEE, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "LGPL-3", + "maintainers": ["mileo", "ygcarvalh", "felipezago"], + "depends": [ + "point_of_sale", + ], + "assets": { + "point_of_sale._assets_pos": [ + "pos_show_clock/static/src/css/pos.css", + "pos_show_clock/static/src/js/ChromeWidgets/Clock.esm.js", + "pos_show_clock/static/src/xml/ChromeWidgets/Clock.xml", + ] + }, +} diff --git a/pos_show_clock/i18n/it.po b/pos_show_clock/i18n/it.po new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_show_clock/i18n/pos_show_clock.pot b/pos_show_clock/i18n/pos_show_clock.pot new file mode 100644 index 0000000000..4d8b20f912 --- /dev/null +++ b/pos_show_clock/i18n/pos_show_clock.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/pos_show_clock/pyproject.toml b/pos_show_clock/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_show_clock/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_show_clock/readme/CONTRIBUTORS.md b/pos_show_clock/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..0cdb1547bf --- /dev/null +++ b/pos_show_clock/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- [KMEE](https://www.kmee.com.br): + - Luis Felipe Mileo \<\> + - Ygor Carvalho \<\> + - Felipe Zago \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/pos_show_clock/readme/CREDITS.md b/pos_show_clock/readme/CREDITS.md new file mode 100644 index 0000000000..a066139229 --- /dev/null +++ b/pos_show_clock/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +- [KMEE](https://www.kmee.com.br) diff --git a/pos_show_clock/readme/DESCRIPTION.md b/pos_show_clock/readme/DESCRIPTION.md new file mode 100644 index 0000000000..5adcdd85d7 --- /dev/null +++ b/pos_show_clock/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module extends the functionality of Point of Sale (point_of_sale) +to display the current time on the main screen. + +![](../static/description/printscreen.png) diff --git a/pos_show_clock/static/description/icon.png b/pos_show_clock/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_show_clock/static/description/icon.png differ diff --git a/pos_show_clock/static/description/index.html b/pos_show_clock/static/description/index.html new file mode 100644 index 0000000000..4ea64ee93f --- /dev/null +++ b/pos_show_clock/static/description/index.html @@ -0,0 +1,444 @@ + + + + + +Pos Show Clock + + + +
+

Pos Show Clock

+ + +

Beta License: LGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

+

This module extends the functionality of Point of Sale (point_of_sale) +to display the current time on the main screen.

+

image1

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • KMEE
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

mileo ygcarvalh felipezago

+

This module is part of the OCA/pos project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/pos_show_clock/static/description/printscreen.png b/pos_show_clock/static/description/printscreen.png new file mode 100644 index 0000000000..4a4d02303a Binary files /dev/null and b/pos_show_clock/static/description/printscreen.png differ diff --git a/pos_show_clock/static/src/css/pos.css b/pos_show_clock/static/src/css/pos.css new file mode 100644 index 0000000000..e0d7f8f060 --- /dev/null +++ b/pos_show_clock/static/src/css/pos.css @@ -0,0 +1,3 @@ +.pos .time { + font-size: 16px; +} diff --git a/pos_show_clock/static/src/js/ChromeWidgets/Clock.esm.js b/pos_show_clock/static/src/js/ChromeWidgets/Clock.esm.js new file mode 100644 index 0000000000..ebbbee0ba8 --- /dev/null +++ b/pos_show_clock/static/src/js/ChromeWidgets/Clock.esm.js @@ -0,0 +1,43 @@ +/** @odoo-module */ + +/* eslint-disable no-unused-vars */ +import {Component, onMounted, onWillUnmount, useState} from "@odoo/owl"; +import {Navbar} from "@point_of_sale/app/navbar/navbar"; +import {parseDateTime} from "@web/core/l10n/dates"; + +class Clock extends Component { + setup() { + super.setup(); + this.state = useState({current_time: this.time}); + onMounted(() => { + this.intervalRef = setInterval(() => this.updateCurrentTime(), 1000); + }); + onWillUnmount(() => { + if (this.intervalRef) { + clearInterval(this.intervalRef); + } + }); + } + + get time() { + return new Date().toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + }); + } + + updateCurrentTime() { + if (this.time <= this.state.current_time) { + return; + } + + this.state.current_time = this.time; + } +} + +Clock.template = "Clock"; + +Navbar.components = { + ...Navbar.components, + Clock: Clock, +}; diff --git a/pos_show_clock/static/src/xml/ChromeWidgets/Clock.xml b/pos_show_clock/static/src/xml/ChromeWidgets/Clock.xml new file mode 100644 index 0000000000..f3ab2f0dc3 --- /dev/null +++ b/pos_show_clock/static/src/xml/ChromeWidgets/Clock.xml @@ -0,0 +1,23 @@ + + + + +
+ + + +
+
+ + + + + + + +