From b20c84e2b1687f85bfe8ea5665cfed6c30971243 Mon Sep 17 00:00:00 2001 From: Abdul Aziz Amrullah Date: Wed, 20 May 2026 16:28:55 +0700 Subject: [PATCH] Initial Commit --- .gitignore | 1 + README.md | 43 +++++++++++++++++++++++++++ __init__.py | 1 + __manifest__.py | 29 ++++++++++++++++++ static/src/xml/receipt_overrides.xml | 44 ++++++++++++++++++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 __init__.py create mode 100644 __manifest__.py create mode 100644 static/src/xml/receipt_overrides.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed8ebf5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..6203a4d --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# POS Custom Receipt + +This custom module is designed for Odoo 19 to override and customize the standard Point of Sale (POS) receipts, specifically adjusting the layout and content of the receipt header and footer. It provides a cleaner and more business-specific printed receipt. + +## Features + +1. **Hide Tracking Number:** + Removes the short `tracking_number` element from the top of the receipt header to avoid confusion with the main POS reference number. + +2. **Custom Ticket Prefix:** + Replaces the default "Ticket" text prefix with "NO" on the main receipt reference sequence (e.g., instead of "Ticket 0001", it prints "NO 0001"). + +3. **Custom "Pro Forma" Text:** + When using the Early Receipt or Bill printing feature (before payment is finalized), Odoo natively prints "Pro forma receipt". This module replaces that text with an attention-grabbing **"!!! INI ADALAH TAGIHAN SEMENTARA, BUKAN BUKTI PEMBAYARAN !!!"**. Furthermore, this text is explicitly hidden when printing a Basic Receipt (gift receipt without prices). + +4. **Address & Email Removal:** + Hides the detailed company/branch address and the company email from the receipt footer, keeping the receipt concise. + +5. **Remove Odoo Branding:** + Hides the "Powered by Odoo" text and logo from the bottom of the receipt footer. + +## Technical Details + +The module utilizes Odoo's OWL `xpath` inheritance mechanism to modify the front-end QWeb templates dynamically. +- `pos_custom_receipt.ReceiptHeader` extends `point_of_sale.ReceiptHeader`. +- `pos_custom_receipt.OrderReceipt` extends `point_of_sale.OrderReceipt`. + +**Dependencies:** +- `point_of_sale`: Base module for the POS system. +- `pos_restaurant`: Required to ensure the proper loading sequence for overriding the "Pro forma receipt" text, which is inherently injected by the restaurant module. + +## Installation + +1. Place the `pos_custom_receipt` directory into your Odoo `custom` addons path. +2. Enable Developer Mode in Odoo. +3. Go to **Apps** -> **Update Apps List**. +4. Search for "POS Custom Receipt" and click **Install**. +5. Once installed, refresh your POS session to load the updated XML assets. + +## Compatibility + +- Odoo Version: **19.0** +- Tested on standard POS and POS Restaurant profiles. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..a449448 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +# Part of Odoo. See LICENSE file for full copyright and licensing details. diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..bae6ccd --- /dev/null +++ b/__manifest__.py @@ -0,0 +1,29 @@ +{ + 'name': 'POS Custom Receipt', + 'version': '1.0', + 'category': 'Sales/Point of Sale', + 'summary': 'Customizes the POS receipt to hide and change certain information.', + 'author': 'Abdul Aziz Amrullah', + 'description': """ +POS Custom Receipt +================== +This module customizes the printed receipt in the Point of Sale module to match specific business requirements. + +Key Features: +- **Tracking Number**: Hides the tracking number in the receipt header. +- **Ticket Prefix**: Changes the "Ticket" prefix to "NO" in the header reference. +- **Address & Email**: Hides the company/branch address and email in the receipt footer. +- **Pro Forma Receipt**: Changes the default "Pro forma receipt" text to "!!! INI ADALAH TAGIHAN SEMENTARA, BUKAN BUKTI PEMBAYARAN !!!" for early/unpaid bills, and explicitly hides this text when printing a Basic Receipt. +- **Odoo Branding**: Removes the "Powered by Odoo" text in the receipt footer. + """, + 'depends': ['point_of_sale', 'pos_restaurant'], + 'data': [], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_custom_receipt/static/src/xml/receipt_overrides.xml', + ], + }, + 'installable': True, + 'application': False, + 'license': 'LGPL-3', +} diff --git a/static/src/xml/receipt_overrides.xml b/static/src/xml/receipt_overrides.xml new file mode 100644 index 0000000..1eaeb23 --- /dev/null +++ b/static/src/xml/receipt_overrides.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + VAT + NO + + + + + + + + + + + + + + +
BELUM DIBAYAR !!!
+
+ + + + + + + + + + + +
+ +