Skip to content
Snippets Groups Projects
Commit 86423e2d authored by Joseph Caburnay's avatar Joseph Caburnay
Browse files

[FIX] l10n_in_pos: receipt rendering error when company has no country


To reproduce:

1. Start with empty instance with point_of_sale (no demo).
2. Install Indian localization from Invoicing.
3. Start a pos session with that config.
4. Sell a product.
5. Assign a customer to the order.
6. Invoice the order during payment.
7. Validate. [BUG] Empty receipt is shown in the receipt screen.

This is because of empty country field of the pos.config's company.
We modify the check for country code in the receipt template to
account for empty country as fix.

closes odoo/odoo#60801

Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
parent 025d2c96
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<templates id="template" xml:space="preserve">
<t t-name="OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('orderlines')]" position="before">
<t t-if="receipt.client and env.pos.company.country.code == 'IN'">
<t t-if="receipt.client and env.pos.company.country and env.pos.company.country.code == 'IN'">
<div class="pos-receipt-center-align">
<div><t t-esc="receipt.client.name" /></div>
<t t-if="receipt.client.phone">
......@@ -16,7 +16,7 @@
</t>
</xpath>
<xpath expr="//WrappedProductNameLines" position="after">
<t t-if="line.l10n_in_hsn_code and env.pos.company.country.code == 'IN'">
<t t-if="line.l10n_in_hsn_code and env.pos.company.country and env.pos.company.country.code == 'IN'">
<div class="pos-receipt-left-padding">
<span>HSN Code: </span>
<t t-esc="line.l10n_in_hsn_code"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment