From 2dad8fdb7c7a18e47217cc59353b00ed2bd80684 Mon Sep 17 00:00:00 2001 From: "Adrien Guilliams (adgu)" Date: Wed, 10 Apr 2024 15:52:58 +0200 Subject: [PATCH] [IMP] point_of_sale: add bidimensional code on receipt chile This commit adds the requirements in order to add the bidimensional code on the receipt of the point of sale for the Chilean localization. closes odoo/odoo#161342 Task-id: 3747828 Related: odoo/enterprise#60451 Signed-off-by: Vlad Stroia (vlst) --- .../static/src/app/utils/report_service.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/point_of_sale/static/src/app/utils/report_service.js b/addons/point_of_sale/static/src/app/utils/report_service.js index dac90e734bc..2ad164716b1 100644 --- a/addons/point_of_sale/static/src/app/utils/report_service.js +++ b/addons/point_of_sale/static/src/app/utils/report_service.js @@ -5,31 +5,31 @@ import { downloadFile } from "@web/core/network/download"; import { downloadReport } from "@web/webclient/actions/reports/utils"; export const reportService = { - dependencies: ["rpc", "user", "ui", "orm"], - start(env, { rpc, user, ui, orm }) { + dependencies: ["rpc", "user", "ui", "orm", "pos"], + start(env, { rpc, user, ui, orm, pos }) { const reportActionsCache = {}; return { async doAction(reportXmlId, active_ids) { ui.block(); try { - if (reportXmlId === "account.account_invoices"){ + if (reportXmlId === "account.account_invoices") { // Get the attachment previously generated by the Send and Print - let [pdf, filename] = await orm.call( + const [pdf, filename] = await orm.call( "account.move", "get_invoice_pdf_report_attachment", - [active_ids], + [active_ids] ); // Convert pdf to a Blob const byteArray = new Uint8Array(pdf.length); for (let i = 0; i < pdf.length; i++) { byteArray[i] = pdf.charCodeAt(i); } - const blob = new Blob([byteArray], {type: "application/pdf"}); + const blob = new Blob([byteArray], { type: "application/pdf" }); // Show the popup to save the pdf await downloadFile(blob, filename, "application/pdf"); } else { reportActionsCache[reportXmlId] ||= rpc("/web/action/load", { - action_id: reportXmlId, + action_id: reportXmlId, }); const reportAction = await reportActionsCache[reportXmlId]; // await instead of return because we want the ui to stay blocked