diff --git a/pos_restaurant_receipt_usability/README.rst b/pos_restaurant_receipt_usability/README.rst new file mode 100644 index 0000000000..83568f5ca4 --- /dev/null +++ b/pos_restaurant_receipt_usability/README.rst @@ -0,0 +1,100 @@ +============================================ +Point of Sale Restaurant - Receipt Usability +============================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1a11d1abc026f34c88ab54049fb5040af0a34796a2e9c332ed124822ab19c20d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/16.0/pos_restaurant_receipt_usability + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_restaurant_receipt_usability + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of Point of Sale Restaurant module, +improving the display of the receipt screen, in a "Split receipt" use case. + +By default, at the end of a split-ticket cashing, on the receipt page, +the user only has the option of clicking on "Next order", +which creates a new blank order. + +In this use case, it is preferable to return to the screen which allows +to continue "splitting" the same ticket, until all the order is paid. + +**Without the module** + +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_restaurant_receipt_usability/static/description/without_module.png + +**With the module** + +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_restaurant_receipt_usability/static/description/with_module.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 +~~~~~~~ + +* GRAP + +Contributors +~~~~~~~~~~~~ + +* Sylvain LE GAL (https://twitter.com/legalsylvain) + +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-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainer `__: + +|maintainer-legalsylvain| + +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_restaurant_receipt_usability/__init__.py b/pos_restaurant_receipt_usability/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_restaurant_receipt_usability/__manifest__.py b/pos_restaurant_receipt_usability/__manifest__.py new file mode 100644 index 0000000000..86fb5f1a08 --- /dev/null +++ b/pos_restaurant_receipt_usability/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2024-Today GRAP (http://www.grap.coop) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + "name": "Point of Sale Restaurant - Receipt Usability", + "summary": "Improve receipt screen in the PoS Restaurant front office", + "version": "16.0.1.0.0", + "category": "Point of Sale", + "maintainers": ["legalsylvain"], + "author": "GRAP,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "AGPL-3", + "depends": ["pos_restaurant", "pos_receipt_usability"], + "assets": { + "point_of_sale.assets": [ + "pos_restaurant_receipt_usability/static/src/**/*.scss", + "pos_restaurant_receipt_usability/static/src/**/*.xml", + "pos_restaurant_receipt_usability/static/src/**/*.js", + ], + }, + "installable": True, +} diff --git a/pos_restaurant_receipt_usability/i18n/fr.po b/pos_restaurant_receipt_usability/i18n/fr.po new file mode 100644 index 0000000000..4fef763d24 --- /dev/null +++ b/pos_restaurant_receipt_usability/i18n/fr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_restaurant_receipt_usability +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-02 09:06+0000\n" +"PO-Revision-Date: 2024-07-02 09:06+0000\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" + +#. module: pos_restaurant_receipt_usability +#. odoo-javascript +#: code:addons/pos_restaurant_receipt_usability/static/src/xml/PaymentScreen.xml:0 +#: code:addons/pos_restaurant_receipt_usability/static/src/xml/PaymentScreen.xml:0 +#: code:addons/pos_restaurant_receipt_usability/static/src/xml/PaymentScreen.xml:0 +#, python-format +msgid "Continue to Cash In" +msgstr "Continuer l'encaissement" diff --git a/pos_restaurant_receipt_usability/readme/CONTRIBUTORS.rst b/pos_restaurant_receipt_usability/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..ae6f43a86d --- /dev/null +++ b/pos_restaurant_receipt_usability/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sylvain LE GAL (https://twitter.com/legalsylvain) diff --git a/pos_restaurant_receipt_usability/readme/DESCRIPTION.rst b/pos_restaurant_receipt_usability/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..4d315e26c5 --- /dev/null +++ b/pos_restaurant_receipt_usability/readme/DESCRIPTION.rst @@ -0,0 +1,17 @@ +This module extends the functionality of Point of Sale Restaurant module, +improving the display of the receipt screen, in a "Split receipt" use case. + +By default, at the end of a split-ticket cashing, on the receipt page, +the user only has the option of clicking on "Next order", +which creates a new blank order. + +In this use case, it is preferable to return to the screen which allows +to continue "splitting" the same ticket, until all the order is paid. + +**Without the module** + +.. figure:: ../static/description/without_module.png + +**With the module** + +.. figure:: ../static/description/with_module.png diff --git a/pos_restaurant_receipt_usability/static/description/index.html b/pos_restaurant_receipt_usability/static/description/index.html new file mode 100644 index 0000000000..babd85e986 --- /dev/null +++ b/pos_restaurant_receipt_usability/static/description/index.html @@ -0,0 +1,439 @@ + + + + + +Point of Sale Restaurant - Receipt Usability + + + +
+

Point of Sale Restaurant - Receipt Usability

+ + +

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

+

This module extends the functionality of Point of Sale Restaurant module, +improving the display of the receipt screen, in a “Split receipt” use case.

+

By default, at the end of a split-ticket cashing, on the receipt page, +the user only has the option of clicking on “Next order”, +which creates a new blank order.

+

In this use case, it is preferable to return to the screen which allows +to continue “splitting” the same ticket, until all the order is paid.

+

Without the module

+
+https://raw.githubusercontent.com/OCA/pos/16.0/pos_restaurant_receipt_usability/static/description/without_module.png +
+

With the module

+
+https://raw.githubusercontent.com/OCA/pos/16.0/pos_restaurant_receipt_usability/static/description/with_module.png +
+

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

+
    +
  • GRAP
  • +
+
+ +
+

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 maintainer:

+

legalsylvain

+

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_restaurant_receipt_usability/static/description/with_module.png b/pos_restaurant_receipt_usability/static/description/with_module.png new file mode 100644 index 0000000000..9d734c5650 Binary files /dev/null and b/pos_restaurant_receipt_usability/static/description/with_module.png differ diff --git a/pos_restaurant_receipt_usability/static/description/without_module.png b/pos_restaurant_receipt_usability/static/description/without_module.png new file mode 100644 index 0000000000..f6a66f9e05 Binary files /dev/null and b/pos_restaurant_receipt_usability/static/description/without_module.png differ diff --git a/pos_restaurant_receipt_usability/static/src/css/pos_restaurant_receipt_usability.scss b/pos_restaurant_receipt_usability/static/src/css/pos_restaurant_receipt_usability.scss new file mode 100644 index 0000000000..977003c834 --- /dev/null +++ b/pos_restaurant_receipt_usability/static/src/css/pos_restaurant_receipt_usability.scss @@ -0,0 +1,29 @@ +/* + Copyright (C) 2024-Today GRAP (http://www.grap.coop) + @author Sylvain LE GAL (https://twitter.com/legalsylvain) + License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +*/ + +.pos .receipt-screen .button.validation.two_button { + width: 49%; + float: left; +} + +.pos .receipt-screen .button.validation.two_button.continue-cash-in { + margin-right: 1%; +} + +.pos .receipt-screen .button.validation.two_button.next { + margin-right: 1%; +} + +.pos .receipt-screen .button.continue-cash-in { + padding: 3rem 0; + height: auto; +} + +.pos .receipt-screen .button.continue-cash-in .fa-chevron-up { + font-size: inherit; + left: 0px; + top: -5px; +} diff --git a/pos_restaurant_receipt_usability/static/src/js/ReceiptScreen.js b/pos_restaurant_receipt_usability/static/src/js/ReceiptScreen.js new file mode 100644 index 0000000000..5cae148971 --- /dev/null +++ b/pos_restaurant_receipt_usability/static/src/js/ReceiptScreen.js @@ -0,0 +1,28 @@ +/* +Copyright (C) 2024-Today: GRAP (http://www.grap.coop) +@author: Sylvain LE GAL (https://twitter.com/legalsylvain) +License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +*/ + +odoo.define("pos_restaurant_receipt_usability.ReceiptScreen", function (require) { + "use strict"; + + const ReceiptScreen = require("point_of_sale.ReceiptScreen"); + const Registries = require("point_of_sale.Registries"); + + const OverloadReceiptScreen = (OriginalReceiptScreen) => + class extends OriginalReceiptScreen { + get hideContinueCashIn() { + return this.env.pos.get_order().splitted_order === false; + } + + continueCashIn() { + var splitted_order = this.env.pos.get_order().splitted_order; + this.env.pos.removeOrder(this.env.pos.get_order()); + this.env.pos.set_order(splitted_order); + this.showScreen("SplitBillScreen"); + } + }; + Registries.Component.extend(ReceiptScreen, OverloadReceiptScreen); + return ReceiptScreen; +}); diff --git a/pos_restaurant_receipt_usability/static/src/js/SplitBillScreen.js b/pos_restaurant_receipt_usability/static/src/js/SplitBillScreen.js new file mode 100644 index 0000000000..2e1eb7bf87 --- /dev/null +++ b/pos_restaurant_receipt_usability/static/src/js/SplitBillScreen.js @@ -0,0 +1,22 @@ +/* +Copyright (C) 2024-Today: GRAP (http://www.grap.coop) +@author: Sylvain LE GAL (https://twitter.com/legalsylvain) +License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +*/ + +odoo.define("pos_restaurant_receipt_usability.SplitBillScreen", function (require) { + "use strict"; + + const SplitBillScreen = require("pos_restaurant.SplitBillScreen"); + const Registries = require("point_of_sale.Registries"); + + const OverloadSplitBillScreen = (OriginalSplitBillScreen) => + class extends OriginalSplitBillScreen { + render() { + // Link the new created order with the original one + this.newOrder.splitted_order = this.env.pos.get_order(); + } + }; + Registries.Component.extend(SplitBillScreen, OverloadSplitBillScreen); + return SplitBillScreen; +}); diff --git a/pos_restaurant_receipt_usability/static/src/js/models.js b/pos_restaurant_receipt_usability/static/src/js/models.js new file mode 100644 index 0000000000..4c8f32697d --- /dev/null +++ b/pos_restaurant_receipt_usability/static/src/js/models.js @@ -0,0 +1,23 @@ +/* +Copyright (C) 2024-Today: GRAP (http://www.grap.coop) +@author: Sylvain LE GAL (https://twitter.com/legalsylvain) +License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +*/ + +odoo.define("pos_restaurant_receipt_usability.models", function (require) { + "use strict"; + + const {Order} = require("point_of_sale.models"); + const Registries = require("point_of_sale.Registries"); + + const OverloadOrder = (OriginalOrder) => + class extends OriginalOrder { + constructor() { + super(...arguments); + this.splitted_order = false; + } + }; + Registries.Model.extend(Order, OverloadOrder); + + return Order; +}); diff --git a/pos_restaurant_receipt_usability/static/src/xml/PaymentScreen.xml b/pos_restaurant_receipt_usability/static/src/xml/PaymentScreen.xml new file mode 100644 index 0000000000..8f66821c79 --- /dev/null +++ b/pos_restaurant_receipt_usability/static/src/xml/PaymentScreen.xml @@ -0,0 +1,42 @@ + + + + + + + {highlight: !locked, 'two_button': !hideContinueCashIn} + + + +
+
+ +
+ Continue to Cash In +
+ +
+ +
+ +
diff --git a/setup/pos_restaurant_receipt_usability/odoo/addons/pos_restaurant_receipt_usability b/setup/pos_restaurant_receipt_usability/odoo/addons/pos_restaurant_receipt_usability new file mode 120000 index 0000000000..93a7507435 --- /dev/null +++ b/setup/pos_restaurant_receipt_usability/odoo/addons/pos_restaurant_receipt_usability @@ -0,0 +1 @@ +../../../../pos_restaurant_receipt_usability \ No newline at end of file diff --git a/setup/pos_restaurant_receipt_usability/setup.py b/setup/pos_restaurant_receipt_usability/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_restaurant_receipt_usability/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)