From 973d4d1e704f2278b0b3373e94a3771bba218422 Mon Sep 17 00:00:00 2001 From: Abdul Aziz Amrullah Date: Fri, 22 May 2026 14:48:32 +0700 Subject: [PATCH] Force remove page padding with css & Hide more elements --- README.md | 12 +++++++++--- __manifest__.py | 3 +++ static/src/css/receipt.css | 20 ++++++++++++++++++++ static/src/xml/receipt_overrides.xml | 17 +++++++++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 static/src/css/receipt.css diff --git a/README.md b/README.md index 6203a4d..600ac2f 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,19 @@ This custom module is designed for Odoo 19 to override and customize the standar 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:** +3. **Hide Cashier Name:** + Hides the "Served by: [Cashier Name]" section from the receipt header for a cleaner look. + +4. **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:** +5. **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:** +6. **Custom Phone Prefix:** + Retains the company phone number in the footer but changes its prefix from the default "Tel:" to "Contact:". + +7. **Remove Odoo Branding:** Hides the "Powered by Odoo" text and logo from the bottom of the receipt footer. ## Technical Details diff --git a/__manifest__.py b/__manifest__.py index bae6ccd..60a9811 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -12,7 +12,9 @@ This module customizes the printed receipt in the Point of Sale module to match Key Features: - **Tracking Number**: Hides the tracking number in the receipt header. - **Ticket Prefix**: Changes the "Ticket" prefix to "NO" in the header reference. +- **Cashier Name**: Hides the "Served by" (cashier name) in the receipt header. - **Address & Email**: Hides the company/branch address and email in the receipt footer. +- **Phone Prefix**: Changes the "Tel:" prefix to "Contact:" for the company phone number in the 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. """, @@ -21,6 +23,7 @@ Key Features: 'assets': { 'point_of_sale._assets_pos': [ 'pos_custom_receipt/static/src/xml/receipt_overrides.xml', + 'pos_custom_receipt/static/src/css/receipt.css', ], }, 'installable': True, diff --git a/static/src/css/receipt.css b/static/src/css/receipt.css new file mode 100644 index 0000000..3aebba3 --- /dev/null +++ b/static/src/css/receipt.css @@ -0,0 +1,20 @@ +@media print { + @page { + margin: 0 !important; + } + body, html { + margin: 0 !important; + padding: 0 !important; + } + .pos-receipt { + padding: 0 !important; + margin: 0 !important; + width: 100% !important; + max-width: 100% !important; + } +} + +.pos-receipt { + padding: 0 !important; + margin: 0 !important; +} diff --git a/static/src/xml/receipt_overrides.xml b/static/src/xml/receipt_overrides.xml index 1eaeb23..1e38f0c 100644 --- a/static/src/xml/receipt_overrides.xml +++ b/static/src/xml/receipt_overrides.xml @@ -14,11 +14,21 @@ NO + + + +
+
+ + + pos-receipt p-0 m-0 + + @@ -29,6 +39,13 @@
BELUM DIBAYAR !!!
+ + +
+ Contact: +
+
+