diff options
| author | Joseph Caburnay <jcb@odoo.com> | 2020-10-27 09:24:18 +0000 |
|---|---|---|
| committer | Joseph Caburnay <jcb@odoo.com> | 2020-10-27 09:24:18 +0000 |
| commit | 86423e2da90e1d023bd616cbc719c80f087a4206 (patch) | |
| tree | b312c2c0549caad3041248979c29f8ec25eedddb /addons/l10n_in_pos | |
| parent | 025d2c9685af74f7ef00530966cb5fb306a31085 (diff) | |
[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: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/l10n_in_pos')
| -rw-r--r-- | addons/l10n_in_pos/static/src/xml/pos_receipt.xml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/l10n_in_pos/static/src/xml/pos_receipt.xml b/addons/l10n_in_pos/static/src/xml/pos_receipt.xml index b406f84278d..ab6e4cb280b 100644 --- a/addons/l10n_in_pos/static/src/xml/pos_receipt.xml +++ b/addons/l10n_in_pos/static/src/xml/pos_receipt.xml @@ -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"/> |
