fix: pos settings invoice_fields not fetched at pos setup (#47855)

This commit is contained in:
Diptanil Saha
2025-06-02 18:24:06 +05:30
committed by GitHub
parent 56fc76f180
commit 0624556ef6

View File

@@ -160,19 +160,18 @@ erpnext.PointOfSale.Controller = class {
this.setup_listener_for_pos_closing(); this.setup_listener_for_pos_closing();
} }
fetch_invoice_fields() { async fetch_invoice_fields() {
const me = this; this.settings.invoice_fields = new Array();
frappe.db.get_doc("POS Settings", undefined).then((doc) => { const pos_settings = await frappe.db.get_doc("POS Settings", undefined);
me.settings.invoice_fields = doc.invoice_fields.map((field) => { pos_settings.invoice_fields.forEach((field) => {
return { this.settings.invoice_fields.push({
fieldname: field.fieldname, fieldname: field.fieldname,
label: field.label, label: field.label,
fieldtype: field.fieldtype, fieldtype: field.fieldtype,
reqd: field.reqd, reqd: field.reqd,
options: field.options, options: field.options,
default_value: field.default_value, default_value: field.default_value,
read_only: field.read_only, read_only: field.read_only,
};
}); });
}); });
} }