From 6bc685def136bef5fece4d848ab81f12d8110fa0 Mon Sep 17 00:00:00 2001 From: "Nicolas (vin)" Date: Mon, 24 Oct 2022 11:02:43 +0000 Subject: [PATCH] [FIX] l10n_gcc_pos: avoid traceback if company has no country There is a check done during the receipt generation in the pos that checks the country code of the company, assuming it is set. But it is possible to have a company without a country set so we need to handle this use case. X-original-commit: 19849c61f0f8b1cb3ddc588885953158482a079f Part-of: odoo/odoo#104389 --- addons/l10n_gcc_pos/static/src/js/OrderReceipt.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/l10n_gcc_pos/static/src/js/OrderReceipt.js b/addons/l10n_gcc_pos/static/src/js/OrderReceipt.js index bb2376f3839..e7fe99acba3 100644 --- a/addons/l10n_gcc_pos/static/src/js/OrderReceipt.js +++ b/addons/l10n_gcc_pos/static/src/js/OrderReceipt.js @@ -10,7 +10,8 @@ odoo.define('l10n_gcc_pos.OrderReceipt', function (require) { get receiptEnv() { let receipt_render_env = super.receiptEnv; let receipt = receipt_render_env.receipt; - receipt.is_gcc_country = ['SA', 'AE', 'BH', 'OM', 'QA', 'KW'].includes(receipt_render_env.order.pos.company.country.code); + const country = receipt_render_env.order.pos.company.country; + receipt.is_gcc_country = ['SA', 'AE', 'BH', 'OM', 'QA', 'KW'].includes(country && country.code); return receipt_render_env; } }