feat: add patches to handle JSON parsing for order and orderline internal notes in KDS
This commit is contained in:
parent
d535b04bca
commit
5e196ab48a
@ -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,
|
||||||
}
|
}
|
||||||
|
|||||||
14
static/src/app/components/order/order_patch.js
Normal file
14
static/src/app/components/order/order_patch.js
Normal 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 }];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
14
static/src/app/components/orderline/orderline_patch.js
Normal file
14
static/src/app/components/orderline/orderline_patch.js
Normal 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 }];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user