feat: add patches to handle JSON parsing for order and orderline internal notes in KDS

This commit is contained in:
Suherdy Yacob 2026-06-02 15:28:33 +07:00
parent d535b04bca
commit 5e196ab48a
3 changed files with 34 additions and 1 deletions

View File

@ -17,7 +17,12 @@ and todo status of previously processed prep order lines.
'version': '19.0.1.0.0', 'version': '19.0.1.0.0',
'depends': ['pos_enterprise'], 'depends': ['pos_enterprise'],
'data': [], '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, 'installable': True,
'auto_install': False, 'auto_install': False,
} }

View File

@ -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 }];
}
}
});

View File

@ -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 }];
}
}
});