refactor: remove unused Orderline patch for receipt internal note parsing
This commit is contained in:
parent
60dca947e1
commit
2224b0c26f
@ -1,25 +1,8 @@
|
|||||||
/** @odoo-module */
|
/** @odoo-module */
|
||||||
|
|
||||||
import { patch } from "@web/core/utils/patch";
|
import { patch } from "@web/core/utils/patch";
|
||||||
import { Orderline } from "@point_of_sale/app/components/orderline/orderline";
|
|
||||||
import { PosOrder } from "@point_of_sale/app/models/pos_order";
|
import { PosOrder } from "@point_of_sale/app/models/pos_order";
|
||||||
|
|
||||||
patch(Orderline.prototype, {
|
|
||||||
get lineScreenValues() {
|
|
||||||
const res = super.lineScreenValues;
|
|
||||||
// In POS, the internal note (line.note) is typically shown only in display mode.
|
|
||||||
// We override this to also include the parsed internalNote when printing receipts.
|
|
||||||
if (this.props.mode === "receipt" && this.line.note) {
|
|
||||||
try {
|
|
||||||
res.internalNote = JSON.parse(this.line.note);
|
|
||||||
} catch (e) {
|
|
||||||
res.internalNote = [{ text: this.line.note }]; // Fallback if not valid JSON
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
patch(PosOrder.prototype, {
|
patch(PosOrder.prototype, {
|
||||||
getCashierName() {
|
getCashierName() {
|
||||||
const pos = this.pos || this.models?.env?.services?.pos;
|
const pos = this.pos || this.models?.env?.services?.pos;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user