feat: filter reward and negative lines from basic receipts, update module author, and document changes

This commit is contained in:
Suherdy Yacob 2026-05-29 21:24:29 +07:00
parent 57b6040ed4
commit 33c8e73003
2 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,7 @@ This custom module is designed for Odoo 19 to override and customize the standar
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 !!!"**. 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 !!!"**.
4. **Basic Receipt Improvements:** 4. **Basic Receipt Improvements:**
When printing a Basic Receipt (e.g. gift receipt without prices), this module hides the receipt header, footer, and the "Pro Forma" text. It also ensures that both the **Customer Note** and the **Internal Note** are fully visible. When printing a Basic Receipt (e.g. gift receipt without prices), this module hides the receipt header, footer, and the "Pro Forma" text. It also ensures that both the **Customer Note** and the **Internal Note** are fully visible, and automatically filters out reward products, promotions, and coupons (lines with negative values or flagged as reward lines).
5. **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. Hides the detailed company/branch address and the company email from the receipt footer, keeping the receipt concise.

View File

@ -30,6 +30,11 @@
<attribute name="t-if">!props.basic_receipt</attribute> <attribute name="t-if">!props.basic_receipt</attribute>
</xpath> </xpath>
<!-- Hide reward/coupon lines on basic receipt -->
<xpath expr="//Orderline" position="attributes">
<attribute name="t-if">!props.basic_receipt || (!line.is_reward_line &amp;&amp; line.price_unit &gt;= 0)</attribute>
</xpath>
<!-- Show order note on basic receipt --> <!-- Show order note on basic receipt -->
<xpath expr="//li[@t-if='line.customerNote']" position="replace"> <xpath expr="//li[@t-if='line.customerNote']" position="replace">
<li t-if="line.customer_note || line.customerNote" class="customer-note w-100 p-2 my-1 rounded text-break"> <li t-if="line.customer_note || line.customerNote" class="customer-note w-100 p-2 my-1 rounded text-break">