Skip to content

Instantly share code, notes, and snippets.

@emwadde
Last active October 10, 2025 03:04
Show Gist options
  • Save emwadde/a58b27f62d93a049b9f8e39ddf0a52f2 to your computer and use it in GitHub Desktop.
Save emwadde/a58b27f62d93a049b9f8e39ddf0a52f2 to your computer and use it in GitHub Desktop.
Odoo PoS Receipt Template
<div class="pos-receipt">
<t t-if="env.services.pos.config.logo">
<img t-att-src="'data:image/png;base64,' + env.services.pos.config.logo" style="width:25%; height:auto;"
alt="Logo" class="pos-receipt-logo"/>
<br />
</t>
<div class="pos-receipt-contact">
<t t-if="env.services.pos.company.name">
<div><t t-esc="env.services.pos.company.name" /></div>
</t>
<t t-if="env.services.pos.company.phone">
<div>Tel:<t t-esc="env.services.pos.company.phone" /></div>
</t>
<t t-if="env.services.pos.company.vat">
<div>TIN:<t t-esc="env.services.pos.company.vat" /></div>
</t>
<t t-if="env.services.pos.company.email">
<div><t t-esc="env.services.pos.company.email" /></div>
</t>
<t t-if="env.services.pos.company.mobile">
<div><t t-esc="env.services.pos.company.mobile" /></div>
</t>
<t t-if="props.receipt.headerData.header">
<t t-out="props.receipt.headerData.header" />
</t>
<t t-if="props.receipt.headerData.cashier">
<div class="cashier">
<div>--------------------------------</div>
<div>Served by <t t-esc="props.receipt.headerData.cashier" /></div>
</div>
</t>
</div>
<br/>
<t t-if="props.receipt.headerData.header">
<div style='text-align:center; font-size:13px'>
<t t-esc="props.receipt.headerData.header" />
</div>
<br />
</t>
<div>
<table class='receipt-orderlines' style="font-size:15px; border-style:double;
border-left:none; border-right:none; border-bottom:none; width:100%;">
<colgroup>
<col width='40%' />
<col width='30%' />
<col width='30%' />
</colgroup>
<tr style="border-bottom:1px dashed black;">
<th style="text-align:left;">Product</th>
<th style="text-align:right;">Qty</th>
<th style="text-align:right;">Amount</th>
</tr>
<t t-if="props.order and props.order.length and props.order and props.order.pos and props.order.pos.mainScreen and props.order.pos.mainScreen.props and props.order.pos.mainScreen.props.order and props.order.pos.mainScreen.props.order.orderlines and props.order.pos.mainScreen.props.order.orderlines.length">
<t t-if="props.order.pos.mainScreen.props">
<tr t-foreach="props.order.pos.mainScreen.props.order.orderlines" t-as="orderline" t-key="index_orderlines">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.productName"/>
<t t-if="orderline.get_discount() > 0">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.get_discount()"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
<div style="font-size:14px;" t-esc="orderline.customerNote"/>
<t t-esc="orderline.get_tax_details()"/>
</t>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.get_quantity_str_with_unit()"/>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="env.utils.formatCurrency(orderline.get_display_price())"/>
</td>
</tr>
</t>
</t>
<t t-else="">
<t t-if="props.orderlines and props.orderlines.length">
<tr t-foreach="props.orderlines" t-as="orderline" t-key="orderline_index">
<td style="padding-top:1%; padding-bottom:1%; text-align:left;">
<t t-esc="orderline.productName"/>
<t t-if="orderline.discount > 0">
<div style="font-size:12px; font-style:italic; color:#808080;">
<t t-esc="orderline.discount"/>% discount
</div>
</t>
<t t-if="orderline.customerNote">
<div style="font-size:14px;" t-esc="orderline.customerNote"/>
</t>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.qty"/>
</td>
<td style="text-align:right; font-size:14px;">
<t t-esc="orderline.price"/>
<t t-if="props.order.lines[orderline_index].tax_ids and props.order.lines[orderline_index].tax_ids.length and props.order.lines[orderline_index].tax_ids[0].name">
<i>(T)</i>
</t>
</td>
</tr>
</t>
</t>
</table>
</div>
<br />
<div style="padding-top:6px;">
<t t-set='taxincluded' t-value='Math.abs(props.receipt.amount_total - props.receipt.total_with_tax) &lt;= 0.000001' />
<t t-if='!taxincluded'>
<br/>
<div style="font-weight:700; font-size:14px; border-top:1px dashed;">
<span style="margin-left:40%;">Subtotal : </span>
<span t-esc='env.utils.formatCurrency(props.data.total_without_tax)'
class="pos-receipt-right-align"/>
</div>
<t t-foreach='props.data.tax_details' t-as='tax' t-key="index_tax_details">
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;"><t t-esc='tax.tax.tax_group_id.name' /></span>
<span t-esc='env.utils.formatCurrency(tax.amount)'
class="pos-receipt-right-align"/>
</div>
</t>
</t>
<!-- Total -->
<br/>
<div style="font-weight:700; font-size:14px;">
<span style="margin-left:40%;">TOTAL : </span>
<span t-esc='env.utils.formatCurrency(props.data.amount_total)' class="pos-receipt-right-align"/>
</div>
<br/><br/>
</div>
<div class='before-footer' />
<br/><br/>
<!-- Footer -->
<div class="pos-receipt-order-data">
<div><t t-esc="props.receipt.name" />
</div>
<t t-if="props.receipt.date">
<div><t t-esc="props.receipt.date" /></div>
</t>
<t t-else="">
<div><t t-esc="props.receipt.date" /></div>
</t>
</div>
<br/><br/>
<div style="font-size:14px; text-align:center;">
<small>Thank You for shopping with us. May God reward you with goodness</small>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment