diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js index 6a344c467a37a67642876daec0ee4dafe62a20ed..008d94264e9c0066f5bc088369a4eea051e67f2e 100644 --- a/erpnext/public/js/utils/sales_common.js +++ b/erpnext/public/js/utils/sales_common.js @@ -75,9 +75,10 @@ erpnext.sales_common = { if (this.frm.fields_dict["items"].grid.get_field("item_code")) { this.frm.set_query("item_code", "items", function () { + const customer = me.frm.doc.doctype == "Quotation" ? me.frm.doc.party_name : me.frm.doc.customer; return { query: "erpnext.controllers.queries.item_query", - filters: { is_sales_item: 1, customer: me.frm.doc.customer, has_variants: 0 }, + filters: { is_sales_item: 1, customer: customer, has_variants: 0 }, }; }); }