diff --git a/pos_early_receipt_printing/README.rst b/pos_early_receipt_printing/README.rst new file mode 100644 index 0000000000..f7c40f4b57 --- /dev/null +++ b/pos_early_receipt_printing/README.rst @@ -0,0 +1,113 @@ +========================== +POS Early Receipt Printing +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b72f153c5e0f9c73d969259c3d3e6d0285d4a323258d5d3b77bace56ee643223 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/pos_early_receipt_printing + :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_early_receipt_printing + :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 allows you to display the option to print bills from the POS +even if it is not a restaurant type. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +1. Go to **Point of Sale**. + +2. Open **Point of Sale → Settings**. + +3. Enable **Early Receipt Printing**: + + - For **shop** Point of Sale configurations, the option is available + in the **Bills & Receipts** section. + - For **restaurant** Point of Sale configurations, the option remains + available in the **Restaurant Mode** section. + +Alternatively, you can configure the option directly from the Point of +Sale configuration form: **Point of Sale → Dashboard → (⋮) → Edit** and +enable **Early Receipt Printing**. + +Usage +===== + +To use this module, you need to: + +1. Configure **Early Receipt Printing** on the desired Point of Sale. +2. Open a new Point of Sale session. +3. Create an order and add one or more products. +4. Click **Actions**. +5. Click **Bill** to print a receipt before completing the payment. + +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 +------- + +* Sygel + +Contributors +------------ + +- `Sygel `__: + + - Valentín Vinagre + - Ángel García de la Chica + - Ángel Rivas + - Harald Panten + +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. + +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_early_receipt_printing/__init__.py b/pos_early_receipt_printing/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_early_receipt_printing/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_early_receipt_printing/__manifest__.py b/pos_early_receipt_printing/__manifest__.py new file mode 100644 index 0000000000..c8b3032450 --- /dev/null +++ b/pos_early_receipt_printing/__manifest__.py @@ -0,0 +1,18 @@ +{ + "name": "POS Early Receipt Printing", + "summary": "Generate bill from Shop", + "version": "18.0.1.0.0", + "category": "POS", + "website": "https://github.com/OCA/pos", + "author": "Sygel, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": ["pos_restaurant"], + "data": ["views/pos_config_views.xml"], + "assets": { + "point_of_sale._assets_pos": [ + "pos_early_receipt_printing/static/src/xml/control_buttons.xml", + ], + }, +} diff --git a/pos_early_receipt_printing/i18n/ca_ES.po b/pos_early_receipt_printing/i18n/ca_ES.po new file mode 100644 index 0000000000..35e391bf76 --- /dev/null +++ b/pos_early_receipt_printing/i18n/ca_ES.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_early_receipt_printing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-06-08 06:23+0000\n" +"PO-Revision-Date: 2026-06-08 08:25+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ca_ES\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" +"X-Generator: Poedit 3.9\n" + +#. module: pos_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.res_config_settings_view_form_pos_printbill +msgid "Allow to print receipt before payment" +msgstr "Permet imprimir el rebut abans del pagament" + +#. module: pos_early_receipt_printing +#. odoo-javascript +#: code:addons/pos_early_receipt_printing/static/src/xml/control_buttons.xml:0 +msgid "Bill" +msgstr "Factura" + +#. module: pos_early_receipt_printing +#: model:ir.model,name:pos_early_receipt_printing.model_res_config_settings +msgid "Config Settings" +msgstr "Paràmetres de configuració" + +#. module: pos_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.res_config_settings_view_form_pos_printbill +msgid "Early Receipt Printing" +msgstr "Impressió de rebut inicial" diff --git a/pos_early_receipt_printing/i18n/es.po b/pos_early_receipt_printing/i18n/es.po new file mode 100644 index 0000000000..6489a44c05 --- /dev/null +++ b/pos_early_receipt_printing/i18n/es.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_early_receipt_printing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-06-08 06:23+0000\n" +"PO-Revision-Date: 2026-06-08 08:24+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\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" +"X-Generator: Poedit 3.9\n" + +#. module: pos_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.res_config_settings_view_form_pos_printbill +msgid "Allow to print receipt before payment" +msgstr "Permitir imprimir el recibo antes del pago" + +#. module: pos_early_receipt_printing +#. odoo-javascript +#: code:addons/pos_early_receipt_printing/static/src/xml/control_buttons.xml:0 +msgid "Bill" +msgstr "Factura" + +#. module: pos_early_receipt_printing +#: model:ir.model,name:pos_early_receipt_printing.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes de configuración" + +#. module: pos_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.res_config_settings_view_form_pos_printbill +msgid "Early Receipt Printing" +msgstr "Impresión anticipada del recibo" diff --git a/pos_early_receipt_printing/i18n/it.po b/pos_early_receipt_printing/i18n/it.po new file mode 100644 index 0000000000..eaaf96e4f4 --- /dev/null +++ b/pos_early_receipt_printing/i18n/it.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_early_receipt_printing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-11-12 09:42+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.10.4\n" + +#. module: pos_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +msgid "Allow to print receipt before payment" +msgstr "Consente di stampare la ricevuta prima del pagamento" + +#. module: pos_early_receipt_printing +#: model:ir.model,name:pos_early_receipt_printing.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: pos_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +msgid "Early Receipt Printing" +msgstr "Stampa ricevuta in anticipo" diff --git a/pos_early_receipt_printing/i18n/pos_early_receipt_printing.pot b/pos_early_receipt_printing/i18n/pos_early_receipt_printing.pot new file mode 100644 index 0000000000..994a2ccc81 --- /dev/null +++ b/pos_early_receipt_printing/i18n/pos_early_receipt_printing.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_early_receipt_printing +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +msgid "Allow to print receipt before payment" +msgstr "" + +#. module: pos_early_receipt_printing +#: model:ir.model,name:pos_early_receipt_printing.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: pos_early_receipt_printing +#: model_terms:ir.ui.view,arch_db:pos_early_receipt_printing.pos_shop_bill_config_view_form +msgid "Early Receipt Printing" +msgstr "" diff --git a/pos_early_receipt_printing/models/__init__.py b/pos_early_receipt_printing/models/__init__.py new file mode 100644 index 0000000000..9cd8dc6796 --- /dev/null +++ b/pos_early_receipt_printing/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2025 Ángel García de la Chica Herrera +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import res_config_settings diff --git a/pos_early_receipt_printing/models/res_config_settings.py b/pos_early_receipt_printing/models/res_config_settings.py new file mode 100644 index 0000000000..131f8cb1e7 --- /dev/null +++ b/pos_early_receipt_printing/models/res_config_settings.py @@ -0,0 +1,20 @@ +# Copyright 2025 Ángel García de la Chica Herrera +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + @api.depends("pos_module_pos_restaurant", "pos_config_id") + def _compute_pos_module_pos_restaurant(self): + res = super()._compute_pos_module_pos_restaurant() + for res_config in self: + if ( + not res_config.pos_module_pos_restaurant + and res_config.pos_config_id.iface_printbill + ): + res_config.pos_iface_printbill = True + res_config.pos_iface_splitbill = False + return res diff --git a/pos_early_receipt_printing/pyproject.toml b/pos_early_receipt_printing/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_early_receipt_printing/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_early_receipt_printing/readme/CONFIGURE.md b/pos_early_receipt_printing/readme/CONFIGURE.md new file mode 100644 index 0000000000..1572e9a5f9 --- /dev/null +++ b/pos_early_receipt_printing/readme/CONFIGURE.md @@ -0,0 +1,11 @@ +To configure this module, you need to: + +1. Go to **Point of Sale**. +2. Open **Point of Sale → Settings**. +3. Enable **Early Receipt Printing**: + + * For **shop** Point of Sale configurations, the option is available in the **Bills & Receipts** section. + * For **restaurant** Point of Sale configurations, the option remains available in the **Restaurant Mode** section. + +Alternatively, you can configure the option directly from the Point of Sale configuration form: +**Point of Sale → Dashboard → (⋮) → Edit** and enable **Early Receipt Printing**. diff --git a/pos_early_receipt_printing/readme/CONTRIBUTORS.md b/pos_early_receipt_printing/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..c4d8a80821 --- /dev/null +++ b/pos_early_receipt_printing/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- [Sygel](https://www.sygel.es): + - Valentín Vinagre + - Ángel García de la Chica + - Ángel Rivas + - Harald Panten diff --git a/pos_early_receipt_printing/readme/DESCRIPTION.md b/pos_early_receipt_printing/readme/DESCRIPTION.md new file mode 100644 index 0000000000..9bbf4901e2 --- /dev/null +++ b/pos_early_receipt_printing/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows you to display the option to print bills from the POS +even if it is not a restaurant type. diff --git a/pos_early_receipt_printing/readme/USAGE.md b/pos_early_receipt_printing/readme/USAGE.md new file mode 100644 index 0000000000..6da3633c4a --- /dev/null +++ b/pos_early_receipt_printing/readme/USAGE.md @@ -0,0 +1,7 @@ +To use this module, you need to: + +1. Configure **Early Receipt Printing** on the desired Point of Sale. +2. Open a new Point of Sale session. +3. Create an order and add one or more products. +4. Click **Actions**. +5. Click **Bill** to print a receipt before completing the payment. diff --git a/pos_early_receipt_printing/static/description/icon.png b/pos_early_receipt_printing/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_early_receipt_printing/static/description/icon.png differ diff --git a/pos_early_receipt_printing/static/description/index.html b/pos_early_receipt_printing/static/description/index.html new file mode 100644 index 0000000000..c413f17e1e --- /dev/null +++ b/pos_early_receipt_printing/static/description/index.html @@ -0,0 +1,461 @@ + + + + + +POS Early Receipt Printing + + + +
+

POS Early Receipt Printing

+ + +

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

+

This module allows you to display the option to print bills from the POS +even if it is not a restaurant type.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Go to Point of Sale.
  2. +
  3. Open Point of Sale → Settings.
  4. +
  5. Enable Early Receipt Printing:
      +
    • For shop Point of Sale configurations, the option is available +in the Bills & Receipts section.
    • +
    • For restaurant Point of Sale configurations, the option remains +available in the Restaurant Mode section.
    • +
    +
  6. +
+

Alternatively, you can configure the option directly from the Point of +Sale configuration form: Point of Sale → Dashboard → (⋮) → Edit and +enable Early Receipt Printing.

+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Configure Early Receipt Printing on the desired Point of Sale.
  2. +
  3. Open a new Point of Sale session.
  4. +
  5. Create an order and add one or more products.
  6. +
  7. Click Actions.
  8. +
  9. Click Bill to print a receipt before completing the payment.
  10. +
+
+
+

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

+
    +
  • Sygel
  • +
+
+
+

Contributors

+
    +
  • Sygel:
      +
    • Valentín Vinagre
    • +
    • Ángel García de la Chica
    • +
    • Ángel Rivas
    • +
    • Harald Panten
    • +
    +
  • +
+
+
+

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.

+

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_early_receipt_printing/static/src/xml/control_buttons.xml b/pos_early_receipt_printing/static/src/xml/control_buttons.xml new file mode 100644 index 0000000000..d19018b8dc --- /dev/null +++ b/pos_early_receipt_printing/static/src/xml/control_buttons.xml @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/pos_early_receipt_printing/tests/__init__.py b/pos_early_receipt_printing/tests/__init__.py new file mode 100644 index 0000000000..20dca70253 --- /dev/null +++ b/pos_early_receipt_printing/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import test_pos_early_receipt_printing diff --git a/pos_early_receipt_printing/tests/test_pos_early_receipt_printing.py b/pos_early_receipt_printing/tests/test_pos_early_receipt_printing.py new file mode 100644 index 0000000000..ef8059bf77 --- /dev/null +++ b/pos_early_receipt_printing/tests/test_pos_early_receipt_printing.py @@ -0,0 +1,42 @@ +# Copyright 2025 Ángel Rivas +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + + +from odoo.tests.common import TransactionCase + + +class TestPosEarlyReceiptPrinting(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.pos_config = cls.env.ref("point_of_sale.pos_config_main").copy( + { + "name": "Test POS Early Receipt", + "module_pos_restaurant": False, + "iface_printbill": True, + "iface_splitbill": True, + } + ) + + def test_printbill_enabled_without_restaurant(self): + settings = self.env["res.config.settings"].create( + { + "pos_config_id": self.pos_config.id, + "pos_module_pos_restaurant": False, + } + ) + settings._compute_pos_module_pos_restaurant() + self.assertTrue(settings.pos_iface_printbill) + self.assertFalse(settings.pos_iface_splitbill) + + def test_printbill_disabled_without_restaurant_when_not_enabled_on_pos(self): + self.pos_config.iface_printbill = False + settings = self.env["res.config.settings"].create( + { + "pos_config_id": self.pos_config.id, + "pos_module_pos_restaurant": False, + } + ) + settings._compute_pos_module_pos_restaurant() + self.assertFalse(settings.pos_iface_printbill) + self.assertFalse(settings.pos_iface_splitbill) diff --git a/pos_early_receipt_printing/views/pos_config_views.xml b/pos_early_receipt_printing/views/pos_config_views.xml new file mode 100644 index 0000000000..121c35a7e8 --- /dev/null +++ b/pos_early_receipt_printing/views/pos_config_views.xml @@ -0,0 +1,39 @@ + + + + pos.shop.bill.config.view.form + + pos.config + + + + + + + + + + res.config.settings.view.form.pos.printbill + res.config.settings + + + + + + + + + +