diff --git a/__manifest__.py b/__manifest__.py index 116e2c5..8986d5c 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -17,7 +17,12 @@ and todo status of previously processed prep order lines. 'version': '19.0.1.0.0', 'depends': ['pos_enterprise'], 'data': [], - 'assets': {}, + 'assets': { + 'pos_preparation_display.assets': [ + 'pos_kds_fix/static/src/app/components/orderline/orderline_patch.js', + 'pos_kds_fix/static/src/app/components/order/order_patch.js', + ], + }, 'installable': True, 'auto_install': False, } diff --git a/static/src/app/components/order/order_patch.js b/static/src/app/components/order/order_patch.js new file mode 100644 index 0000000..ccceb83 --- /dev/null +++ b/static/src/app/components/order/order_patch.js @@ -0,0 +1,14 @@ +/** @odoo-module **/ + +import { Order } from "@pos_enterprise/app/components/order/order"; +import { patch } from "@web/core/utils/patch"; + +patch(Order.prototype, { + get pdisNotes() { + try { + return JSON.parse(this.order.pos_order_id.internal_note || "[]"); + } catch (e) { + return [{ text: this.order.pos_order_id.internal_note, colorIndex: 0 }]; + } + } +}); diff --git a/static/src/app/components/orderline/orderline_patch.js b/static/src/app/components/orderline/orderline_patch.js new file mode 100644 index 0000000..9a77314 --- /dev/null +++ b/static/src/app/components/orderline/orderline_patch.js @@ -0,0 +1,14 @@ +/** @odoo-module **/ + +import { Orderline } from "@pos_enterprise/app/components/orderline/orderline"; +import { patch } from "@web/core/utils/patch"; + +patch(Orderline.prototype, { + get internalNotes() { + try { + return JSON.parse(this.preparation_line.internal_note || "[]"); + } catch (e) { + return [{ text: this.preparation_line.internal_note, colorIndex: 0 }]; + } + } +});