From 9cb6dc8ac5f2d8fc0709cb251826bd1458282d6f Mon Sep 17 00:00:00 2001 From: "matthias.lotz" Date: Tue, 6 Jan 2026 14:03:55 +0100 Subject: [PATCH] Add partner name display in POS receipt header - Patch PosOrder.export_for_printing() to include partner data in headerData - Update receipt header template to display partner name above tracking number - Partner name shown only when partner is selected for the order --- .../static/src/js/ows_receipt_header_patch.js | 19 +++++++++++++++++++ .../src/xml/ows_receipt_header_patch.xml | 14 ++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 open_workshop_pos/static/src/js/ows_receipt_header_patch.js create mode 100644 open_workshop_pos/static/src/xml/ows_receipt_header_patch.xml diff --git a/open_workshop_pos/static/src/js/ows_receipt_header_patch.js b/open_workshop_pos/static/src/js/ows_receipt_header_patch.js new file mode 100644 index 0000000..a00d169 --- /dev/null +++ b/open_workshop_pos/static/src/js/ows_receipt_header_patch.js @@ -0,0 +1,19 @@ +/** @odoo-module */ + +import { PosOrder } from "@point_of_sale/app/models/pos_order"; +import { patch } from "@web/core/utils/patch"; + +// Patch the export_for_printing method to include partner data +patch(PosOrder.prototype, { + export_for_printing(baseUrl, headerData) { + const result = super.export_for_printing(baseUrl, headerData); + + // Add partner name to headerData if partner exists + const partner = this.get_partner(); + if (partner && result.headerData) { + result.headerData.partnerName = partner.name; + } + + return result; + } +}); diff --git a/open_workshop_pos/static/src/xml/ows_receipt_header_patch.xml b/open_workshop_pos/static/src/xml/ows_receipt_header_patch.xml new file mode 100644 index 0000000..e55cd05 --- /dev/null +++ b/open_workshop_pos/static/src/xml/ows_receipt_header_patch.xml @@ -0,0 +1,14 @@ + + + + + + +
+ +
+
+
+