From 8037bec6d8f4bc2de622bf3c08a9f903412fbc2c Mon Sep 17 00:00:00 2001 From: "Pedram (PEBR)" Date: Wed, 29 Nov 2023 15:56:41 +0100 Subject: [PATCH] [FIX] l10n_gcc_pos: include is_gcc_country in ReceiptHeader There was an inconsistency due to the separation of ReceiptHeader from OrderReceipt. The 'is_gcc_country', which is utilized in both l10n_gcc_pos and l10n_sa_pos modules within the ReceiptHeader, was not being appropriately passed due to this separation. This commit resolves the issue by overriding the 'getReceiptHeaderData' method to include the 'is_gcc_country' in the ReceiptHeader data. This ensures that the ReceiptHeader correctly reflects the necessary information. opw-3610862 closes odoo/odoo#144223 Signed-off-by: Joseph Caburnay (jcb) --- .../l10n_gcc_pos/static/src/overrides/models.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 addons/l10n_gcc_pos/static/src/overrides/models.js diff --git a/addons/l10n_gcc_pos/static/src/overrides/models.js b/addons/l10n_gcc_pos/static/src/overrides/models.js new file mode 100644 index 00000000000..eae7dec4277 --- /dev/null +++ b/addons/l10n_gcc_pos/static/src/overrides/models.js @@ -0,0 +1,15 @@ +/** @odoo-module */ + +import { patch } from "@web/core/utils/patch"; +import { PosStore } from "@point_of_sale/app/store/pos_store"; + +patch(PosStore.prototype, { + getReceiptHeaderData() { + return { + ...super.getReceiptHeaderData(), + is_gcc_country: ["SA", "AE", "BH", "OM", "QA", "KW"].includes( + this.company.country?.code + ), + }; + }, +});