mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
fix: Use party_name instead of customer in Quotation set_query
This commit is contained in:
@@ -75,9 +75,13 @@ erpnext.sales_common = {
|
|||||||
|
|
||||||
if (this.frm.fields_dict["items"].grid.get_field("item_code")) {
|
if (this.frm.fields_dict["items"].grid.get_field("item_code")) {
|
||||||
this.frm.set_query("item_code", "items", function () {
|
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 {
|
return {
|
||||||
query: "erpnext.controllers.queries.item_query",
|
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 },
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user