refactor: move is_quotation_line registration to export_as_JSON patch instead of static array push

This commit is contained in:
Suherdy Yacob 2026-05-06 11:01:46 +07:00
parent 397da50866
commit 811e1be4f5

View File

@ -8,7 +8,16 @@ import { _t } from "@web/core/l10n/translation";
import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/order_receipt"; import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/order_receipt";
import { onError } from "@odoo/owl"; import { onError } from "@odoo/owl";
PosOrderline.extraFields.push("is_quotation_line"); // Field is now loaded via _load_pos_data_fields in Python
patch(PosOrderline.prototype, {
export_as_JSON() {
const json = super.export_as_JSON(...arguments);
json.is_quotation_line = this.is_quotation_line;
return json;
}
});
patch(PosStore.prototype, { patch(PosStore.prototype, {
async pay() { async pay() {