diff --git a/pos_payment_force_done_confirm/README.rst b/pos_payment_force_done_confirm/README.rst new file mode 100644 index 0000000000..11446fecc5 --- /dev/null +++ b/pos_payment_force_done_confirm/README.rst @@ -0,0 +1,54 @@ +=============================== +POS Payment Force Done Confirm +=============================== + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +|badge1| |badge2| + +**POS Payment Force Done Confirmation** asks the cashier to confirm before using +**Force Done** on a payment line in the Point of Sale (for example when the +terminal flow was interrupted but the card was actually charged). The goal is to +limit accidental clicks that can desynchronize the POS with real card capture. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Install the module and open the POS. When you click **Force Done** on a payment +line, a dialog appears. Choose **No, go back** to cancel, or **Yes** to apply +**Force Done** as in standard Odoo. + +Bug Tracker +=========== + +Bugs are tracked on GitHub Issues. In case of problems, please check there if +your issue has already been reported. + +Credits +======= + +Authors +~~~~~~~ + +* CHEF PIXEL + +Maintainers +~~~~~~~~~~~ + +This module is maintained by its authors. + +License +======= + +This project is licensed under LGPL-3.0 or later +(`see `_). diff --git a/pos_payment_force_done_confirm/__init__.py b/pos_payment_force_done_confirm/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_payment_force_done_confirm/__manifest__.py b/pos_payment_force_done_confirm/__manifest__.py new file mode 100644 index 0000000000..9dd07af52a --- /dev/null +++ b/pos_payment_force_done_confirm/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright (C) 2023 - Today: GRAP (http://www.grap.coop) +# Copyright 2026 CHEF PIXEL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "POS Payment Force Done Confirmation", + "version": "19.0.1.0.0", + "category": "Point of Sale", + "summary": "Ask for confirmation before marking a terminal payment as done.", + "author": "CHEF PIXEL, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "LGPL-3", + "depends": ["point_of_sale"], + "assets": { + "point_of_sale._assets_pos": [ + "pos_payment_force_done_confirm/static/src/app/screens/payment_screen/payment_screen.esm.js", + ], + }, + "installable": True, + "application": False, + "auto_install": False, +} diff --git a/pos_payment_force_done_confirm/i18n/fr.po b/pos_payment_force_done_confirm/i18n/fr.po new file mode 100644 index 0000000000..8acf19aa31 --- /dev/null +++ b/pos_payment_force_done_confirm/i18n/fr.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_force_done_confirm +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 19.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-04-10 00:00+0000\n" +"PO-Revision-Date: 2026-04-10 00:00+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: pos_payment_force_done_confirm +#. odoo-javascript +#: static/src/app/screens/payment_screen/payment_screen.js:0 +msgid "Warning: are you sure you have collected payment from the customer by card? You risk desynchronizing the point of sale." +msgstr "Attention, êtes-vous certain d'avoir encaissé le client par carte ? Vous risquez de désynchroniser le point de caisse." + +#. module: pos_payment_force_done_confirm +#. odoo-javascript +#: static/src/app/screens/payment_screen/payment_screen.js:0 +msgid "No, go back" +msgstr "Non, je reviens en arrière" + +#. module: pos_payment_force_done_confirm +#. odoo-javascript +#: static/src/app/screens/payment_screen/payment_screen.js:0 +msgid "Yes" +msgstr "Oui" diff --git a/pos_payment_force_done_confirm/pyproject.toml b/pos_payment_force_done_confirm/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_payment_force_done_confirm/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_payment_force_done_confirm/static/src/app/screens/payment_screen/payment_screen.esm.js b/pos_payment_force_done_confirm/static/src/app/screens/payment_screen/payment_screen.esm.js new file mode 100644 index 0000000000..567dac1f1b --- /dev/null +++ b/pos_payment_force_done_confirm/static/src/app/screens/payment_screen/payment_screen.esm.js @@ -0,0 +1,24 @@ +import {_t} from "@web/core/l10n/translation"; +import {PaymentScreen} from "@point_of_sale/app/screens/payment_screen/payment_screen"; +import {ConfirmationDialog} from "@web/core/confirmation_dialog/confirmation_dialog"; +import {patch} from "@web/core/utils/patch"; + +const originalSendForceDone = PaymentScreen.prototype.sendForceDone; + +patch(PaymentScreen.prototype, { + async sendForceDone(line) { + this.dialog.add(ConfirmationDialog, { + body: _t( + "Warning: are you sure you have collected payment from the customer by card? You risk desynchronizing the point of sale." + ), + confirmLabel: _t("No, go back"), + confirm() { + return; + }, + cancelLabel: _t("Yes"), + cancel: async () => { + await originalSendForceDone.call(this, line); + }, + }); + }, +});