Merge pull request #46951 from cogk/fix-use-party_name-instead-of-customer-in-set_query-of-quotation-items

fix: Use `party_name` instead of `customer` in `set_query` of Quotation items
This commit is contained in:
ruthra kumar
2025-04-15 15:45:27 +05:30
committed by GitHub

View File

@@ -75,9 +75,13 @@ erpnext.sales_common = {
if (this.frm.fields_dict["items"].grid.get_field("item_code")) {
this.frm.set_query("item_code", "items", function () {
let customer = me.frm.doc.customer;
if (me.frm.doc.doctype == "Quotation" && me.frm.doc.quotation_to == "Customer") {
customer = me.frm.doc.party_name;
}
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 },
};
});
}