diff --git a/README.md b/README.md index 477288a0fc..0ebebcdf21 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- +[pos_blind_session_closing](pos_blind_session_closing/) | 19.0.1.0.0 | | POS Edit Order Line [pos_edit_order_line](pos_edit_order_line/) | 19.0.1.0.0 | | POS Edit Order Line [pos_partner_birthdate](pos_partner_birthdate/) | 19.0.1.0.0 | ecino | Adds the birthdate in the customer screen of POS diff --git a/pos_blind_session_closing/README.rst b/pos_blind_session_closing/README.rst new file mode 100644 index 0000000000..59e3d6faac --- /dev/null +++ b/pos_blind_session_closing/README.rst @@ -0,0 +1,126 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=========================== +POS - Blind Session Closing +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2a7aca22c7b565d46f5420abf05aad0b86d93fead3916e79900b677759189ba6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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/19.0/pos_blind_session_closing + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-19-0/pos-19-0-pos_blind_session_closing + :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=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module hides the expected amounts during POS session closing to +allow blind cash control. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module and enable blind closing in the POS, follow these +steps: + +1. Navigate to **Settings** → **Users & Companies** → **Users** + +2. Open the user who should be allowed to see the expected closing + amounts + +3. In the **Extra Rights** tab, enable the group: + + - **Can see POS closing amounts** + +4. Users **with this group** will be able to see the expected amounts + during the POS session closing. + +5. Users **without this group** will perform a **blind closing**, + meaning: + + - Expected cash amounts are hidden + - Only counted amounts can be entered + +**Notes:** + +- This allows managers or supervisors to see the expected totals while + regular cashiers perform a blind cash count. +- The feature applies to the **POS closing popup** when ending a + session. + +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 +------- + +* APSL-Nagarro + +Contributors +------------ + +- `APSL-Nagarro `__: + + - Bernat Obrador + +- `Cloud Lotus `__: + + - Roberto Cifuentes + +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-BernatObrador| image:: https://github.com/BernatObrador.png?size=40px + :target: https://github.com/BernatObrador + :alt: BernatObrador + +Current `maintainer `__: + +|maintainer-BernatObrador| + +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_blind_session_closing/__init__.py b/pos_blind_session_closing/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_blind_session_closing/__manifest__.py b/pos_blind_session_closing/__manifest__.py new file mode 100644 index 0000000000..a6d2b926e6 --- /dev/null +++ b/pos_blind_session_closing/__manifest__.py @@ -0,0 +1,23 @@ +{ + "name": "POS - Blind Session Closing", + "version": "19.0.1.0.0", + "summary": "Hide cash control details in the closing popup", + "category": "Point of Sale", + "author": "APSL-Nagarro, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "AGPL-3", + "maintainers": ["BernatObrador"], + "depends": ["point_of_sale"], + "data": [ + "security/security.xml", + ], + "assets": { + "point_of_sale._assets_pos": [ + "pos_blind_session_closing/static/src/**/*", + ], + "web.assets_tests": [ + "pos_blind_session_closing/static/tests/tours/pos_blind_session_closing_tour.esm.js", + ], + }, + "installable": True, +} diff --git a/pos_blind_session_closing/i18n/es_MX.po b/pos_blind_session_closing/i18n/es_MX.po new file mode 100644 index 0000000000..d1c0dc6f43 --- /dev/null +++ b/pos_blind_session_closing/i18n/es_MX.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_blind_session_closing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-04-08 12:45+0000\n" +"Last-Translator: roberto \n" +"Language-Team: none\n" +"Language: es_MX\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: pos_blind_session_closing +#: model:res.groups,name:pos_blind_session_closing.group_pos_close_session_amounts +msgid "Can see POS closing amounts" +msgstr "Puede ver el monto de cierre del PDV" diff --git a/pos_blind_session_closing/i18n/it.po b/pos_blind_session_closing/i18n/it.po new file mode 100644 index 0000000000..f82d2afa77 --- /dev/null +++ b/pos_blind_session_closing/i18n/it.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_blind_session_closing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-04-08 12:45+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.15.2\n" + +#. module: pos_blind_session_closing +#: model:res.groups,name:pos_blind_session_closing.group_pos_close_session_amounts +msgid "Can see POS closing amounts" +msgstr "Può vedere i valori di chiusura del POS" diff --git a/pos_blind_session_closing/i18n/pos_blind_session_closing.pot b/pos_blind_session_closing/i18n/pos_blind_session_closing.pot new file mode 100644 index 0000000000..38bad7a4bd --- /dev/null +++ b/pos_blind_session_closing/i18n/pos_blind_session_closing.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_blind_session_closing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 19.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" + +#. module: pos_blind_session_closing +#: model:res.groups,name:pos_blind_session_closing.group_pos_close_session_amounts +msgid "Can see POS closing amounts" +msgstr "" diff --git a/pos_blind_session_closing/pyproject.toml b/pos_blind_session_closing/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_blind_session_closing/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_blind_session_closing/readme/CONTRIBUTORS.md b/pos_blind_session_closing/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..fec74215a9 --- /dev/null +++ b/pos_blind_session_closing/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- [APSL-Nagarro](https://apsl.tech): + - Bernat Obrador \<\> +- [Cloud Lotus](https://cloudlotus.net): + - Roberto Cifuentes \<\> diff --git a/pos_blind_session_closing/readme/DESCRIPTION.md b/pos_blind_session_closing/readme/DESCRIPTION.md new file mode 100644 index 0000000000..e7b7037abe --- /dev/null +++ b/pos_blind_session_closing/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module hides the expected amounts during POS session closing to allow blind cash control. \ No newline at end of file diff --git a/pos_blind_session_closing/readme/USAGE.md b/pos_blind_session_closing/readme/USAGE.md new file mode 100644 index 0000000000..f8225b5271 --- /dev/null +++ b/pos_blind_session_closing/readme/USAGE.md @@ -0,0 +1,19 @@ +To use this module and enable blind closing in the POS, follow these steps: + +1. Navigate to **Settings** → **Users & Companies** → **Users** + +2. Open the user who should be allowed to see the expected closing amounts + +3. In the **Extra Rights** tab, enable the group: + - **Can see POS closing amounts** + +4. Users **with this group** will be able to see the expected amounts during the POS session closing. + +5. Users **without this group** will perform a **blind closing**, meaning: + - Expected cash amounts are hidden + - Only counted amounts can be entered + +**Notes:** + +- This allows managers or supervisors to see the expected totals while regular cashiers perform a blind cash count. +- The feature applies to the **POS closing popup** when ending a session. diff --git a/pos_blind_session_closing/security/security.xml b/pos_blind_session_closing/security/security.xml new file mode 100644 index 0000000000..87f995873c --- /dev/null +++ b/pos_blind_session_closing/security/security.xml @@ -0,0 +1,10 @@ + + + + Can see POS closing amounts + + + diff --git a/pos_blind_session_closing/static/description/icon.png b/pos_blind_session_closing/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_blind_session_closing/static/description/icon.png differ diff --git a/pos_blind_session_closing/static/description/index.html b/pos_blind_session_closing/static/description/index.html new file mode 100644 index 0000000000..997d52513e --- /dev/null +++ b/pos_blind_session_closing/static/description/index.html @@ -0,0 +1,469 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

POS - Blind Session Closing

+ +

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

+

This module hides the expected amounts during POS session closing to +allow blind cash control.

+

Table of contents

+ +
+

Usage

+

To use this module and enable blind closing in the POS, follow these +steps:

+
    +
  1. Navigate to SettingsUsers & CompaniesUsers
  2. +
  3. Open the user who should be allowed to see the expected closing +amounts
  4. +
  5. In the Extra Rights tab, enable the group:
      +
    • Can see POS closing amounts
    • +
    +
  6. +
  7. Users with this group will be able to see the expected amounts +during the POS session closing.
  8. +
  9. Users without this group will perform a blind closing, +meaning:
      +
    • Expected cash amounts are hidden
    • +
    • Only counted amounts can be entered
    • +
    +
  10. +
+

Notes:

+
    +
  • This allows managers or supervisors to see the expected totals while +regular cashiers perform a blind cash count.
  • +
  • The feature applies to the POS closing popup when ending a +session.
  • +
+
+
+

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

+
    +
  • APSL-Nagarro
  • +
+
+
+

Contributors

+ +
+
+

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:

+

BernatObrador

+

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_blind_session_closing/static/src/js/closing_popup.esm.js b/pos_blind_session_closing/static/src/js/closing_popup.esm.js new file mode 100644 index 0000000000..d1d1e67512 --- /dev/null +++ b/pos_blind_session_closing/static/src/js/closing_popup.esm.js @@ -0,0 +1,14 @@ +/** + * Copyright 2026 Bernat Obrador APSL-Nagarro + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + */ + +import {ClosePosPopup} from "@point_of_sale/app/components/popups/closing_popup/closing_popup"; +import {patch} from "@web/core/utils/patch"; + +patch(ClosePosPopup.prototype, { + setup() { + super.setup(...arguments); + this.canSeeClosingAmounts = this.pos.canSeeClosingAmounts; + }, +}); diff --git a/pos_blind_session_closing/static/src/js/pos_store.esm.js b/pos_blind_session_closing/static/src/js/pos_store.esm.js new file mode 100644 index 0000000000..cb7cd533de --- /dev/null +++ b/pos_blind_session_closing/static/src/js/pos_store.esm.js @@ -0,0 +1,16 @@ +/** + * Copyright 2026 Bernat Obrador APSL-Nagarro + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + */ +import {PosStore} from "@point_of_sale/app/services/pos_store"; +import {patch} from "@web/core/utils/patch"; +import {user} from "@web/core/user"; + +patch(PosStore.prototype, { + async processServerData() { + await super.processServerData(...arguments); + this.canSeeClosingAmounts = await user.hasGroup( + "pos_blind_session_closing.group_pos_close_session_amounts" + ); + }, +}); diff --git a/pos_blind_session_closing/static/src/xml/closing_popup.xml b/pos_blind_session_closing/static/src/xml/closing_popup.xml new file mode 100644 index 0000000000..9ef12291b5 --- /dev/null +++ b/pos_blind_session_closing/static/src/xml/closing_popup.xml @@ -0,0 +1,35 @@ + + + + + + + this.canSeeClosingAmounts + + + + this.canSeeClosingAmounts + + + + this.canSeeClosingAmounts + + + + this.canSeeClosingAmounts + + + diff --git a/pos_blind_session_closing/static/tests/tours/pos_blind_session_closing_tour.esm.js b/pos_blind_session_closing/static/tests/tours/pos_blind_session_closing_tour.esm.js new file mode 100644 index 0000000000..e62ccb36bb --- /dev/null +++ b/pos_blind_session_closing/static/tests/tours/pos_blind_session_closing_tour.esm.js @@ -0,0 +1,92 @@ +/* global document */ +import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; +import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util"; + +import {registry} from "@web/core/registry"; + +const CLOSE_POS_POPUP = ".close-pos-popup, .modal-dialog"; +const TOTAL_ORDERS = ".total-orders"; +const PAYMENT_METHODS_OVERVIEW = ".payment-methods-overview"; + +const CLONE_BUTTON = "button.icon.fa.fa-clone.btn.btn-secondary"; +const SECONDARY_BUTTON = "button.button.icon.btn.btn-secondary"; + +function openClosePosPopup() { + return [ + Chrome.startPoS(), + Dialog.confirm("Open Register"), + Chrome.clickMenuOption("Close Register"), + { + trigger: CLOSE_POS_POPUP, + }, + ]; +} + +registry + .category("web_tour.tours") + .add("pos_blind_session_closing_visible_for_manager", { + steps: () => + [ + ...openClosePosPopup(), + + { + trigger: TOTAL_ORDERS, + }, + { + trigger: PAYMENT_METHODS_OVERVIEW, + }, + { + trigger: CLONE_BUTTON, + }, + { + trigger: SECONDARY_BUTTON, + }, + Chrome.endTour(), + ].flat(), + }); + +registry + .category("web_tour.tours") + .add("pos_blind_session_closing_hidden_for_cashier", { + steps: () => + [ + ...openClosePosPopup(), + + { + trigger: CLOSE_POS_POPUP, + run: function () { + const root = + document.querySelector(CLOSE_POS_POPUP) || document; + + const totalOrders = root.querySelector(TOTAL_ORDERS); + const paymentOverview = root.querySelector( + PAYMENT_METHODS_OVERVIEW + ); + const cloneButton = root.querySelector(CLONE_BUTTON); + const secondaryButton = root.querySelector(SECONDARY_BUTTON); + + if (totalOrders) { + throw new Error( + "The total orders section should be hidden for users without closing visibility rights." + ); + } + if (paymentOverview) { + throw new Error( + "The payment methods overview should be hidden for users without closing visibility rights." + ); + } + if (cloneButton) { + throw new Error( + "The clone/details button should be hidden for users without closing visibility rights." + ); + } + if (secondaryButton) { + throw new Error( + "The secondary closing action button should be hidden for users without closing visibility rights." + ); + } + }, + }, + Chrome.endTour(), + ].flat(), + }); diff --git a/pos_blind_session_closing/tests/__init__.py b/pos_blind_session_closing/tests/__init__.py new file mode 100644 index 0000000000..875253ee6d --- /dev/null +++ b/pos_blind_session_closing/tests/__init__.py @@ -0,0 +1 @@ +from . import test_pos_blind_session_closing diff --git a/pos_blind_session_closing/tests/test_pos_blind_session_closing.py b/pos_blind_session_closing/tests/test_pos_blind_session_closing.py new file mode 100644 index 0000000000..c94d25b30b --- /dev/null +++ b/pos_blind_session_closing/tests/test_pos_blind_session_closing.py @@ -0,0 +1,51 @@ +from odoo.tests import tagged + +from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon + + +@tagged("post_install", "-at_install") +class TestPosBlindClosing(TestPointOfSaleHttpCommon): + def _create_user(self, login, groups): + return ( + self.env["res.users"] + .with_context(no_reset_password=True) + .create( + { + "name": login, + "login": login, + "email": f"{login}@example.com", + "group_ids": [(6, 0, groups)], + } + ) + ) + + def test_blind_closing_hidden_for_cashier(self): + base_user = self.env.ref("base.group_user").id + pos_user_group = self.env.ref("point_of_sale.group_pos_user").id + + user = self._create_user( + "pos_cashier_blind_closing_test", + [base_user, pos_user_group], + ) + + self.start_pos_tour( + "pos_blind_session_closing_hidden_for_cashier", + login=user.login, + ) + + def test_blind_closing_visible_for_authorized_user(self): + base_user = self.env.ref("base.group_user").id + pos_user_group = self.env.ref("point_of_sale.group_pos_user").id + can_see_closing_amounts = self.env.ref( + "pos_blind_session_closing.group_pos_close_session_amounts" + ).id + + user = self._create_user( + "pos_manager_blind_closing_test", + [base_user, pos_user_group, can_see_closing_amounts], + ) + + self.start_pos_tour( + "pos_blind_session_closing_visible_for_manager", + login=user.login, + )