Initial Commit

This commit is contained in:
Abdul Aziz Amrullah 2026-05-20 16:28:55 +07:00
commit b20c84e2b1
5 changed files with 118 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__

43
README.md Normal file
View File

@ -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.

1
__init__.py Normal file
View File

@ -0,0 +1 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

29
__manifest__.py Normal file
View File

@ -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',
}

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- Hide Tracking Number from Receipt Header -->
<t t-name="pos_custom_receipt.ReceiptHeader" t-inherit="point_of_sale.ReceiptHeader" t-inherit-mode="extension">
<xpath expr="//div[span[hasclass('tracking-number')]]" position="replace">
<!-- Tracking number is hidden -->
</xpath>
<!-- Replace "Ticket" with "NO" -->
<xpath expr="//span[hasclass('ticket-name-prefix')]" position="replace">
<span class="ticket-name-prefix">
<t t-if="order.config._IS_VAT"> VAT </t>
NO
</span>
</xpath>
</t>
<!-- Hide Address, Phone, Email, and Powered By from Receipt Footer -->
<t t-name="pos_custom_receipt.OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
<!-- Hide Address (Branch Address) -->
<xpath expr="//div[hasclass('w-50', 'text-start')]/div[2]" position="replace">
<!-- Branch address is hidden -->
</xpath>
<!-- Replace 'Pro forma receipt' text -->
<xpath expr="//div[contains(text(), 'Pro forma receipt')]" position="replace">
<div t-if="!order.finalized and !props.basic_receipt" class="fs-2 mb-1">BELUM DIBAYAR !!!</div>
</xpath>
<!-- Hide Email -->
<xpath expr="//div[@t-if='company.email']" position="replace">
<!-- Email is hidden -->
</xpath>
<!-- Hide 'Powered by Odoo' text -->
<xpath expr="//div[span[contains(text(), 'Powered by')]]" position="replace">
<!-- Powered by Odoo is hidden -->
</xpath>
</t>
</templates>