From 769c73e4a6802ff8bf63c33e2c0c82ba33f814e4 Mon Sep 17 00:00:00 2001 From: Aghiles ForLead Date: Tue, 8 Apr 2025 12:53:42 +0000 Subject: [PATCH 1/4] =?UTF-8?q?FIX=20:=20Le=20filtre=20sur=20Article=20li?= =?UTF-8?q?=C3=A9=20au=20tiers=20ne=20fonctionne=20pas=20dans=20Devis=20(C?= =?UTF-8?q?ause=20:=20champ=20"customer"=20inexistant)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erpnext/public/js/utils/sales_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js index 6a344c467a3..d50abdcbbfa 100644 --- a/erpnext/public/js/utils/sales_common.js +++ b/erpnext/public/js/utils/sales_common.js @@ -77,7 +77,7 @@ erpnext.sales_common = { this.frm.set_query("item_code", "items", function () { 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': me.frm.doc.doctype == "Quotation" ? me.frm.doc.party_name : me.frm.doc.customer, 'has_variants': 0} }; }); } -- GitLab From 2ae8f52b74596fff12bf4f176d1a96a5733e192e Mon Sep 17 00:00:00 2001 From: Corentin Forler <8860073-cforler_dokos@users.noreply.gitlab.com> Date: Tue, 8 Apr 2025 15:04:00 +0200 Subject: [PATCH 2/4] Apply 1 suggestion(s) to 1 file(s) --- erpnext/public/js/utils/sales_common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js index d50abdcbbfa..ce1616878c7 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.doctype == "Quotation" ? me.frm.doc.party_name : me.frm.doc.customer, 'has_variants': 0} + filters: {is_sales_item: 1, customer: customer, has_variants: 0} }; }); } -- GitLab From 452fa8709d0a08bfb6cfd702a5ad469aa0c9fddc Mon Sep 17 00:00:00 2001 From: Corentin Forler <8860073-cforler_dokos@users.noreply.gitlab.com> Date: Tue, 8 Apr 2025 15:04:29 +0200 Subject: [PATCH 3/4] Apply 1 suggestion(s) to 1 file(s) --- erpnext/public/js/utils/sales_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js index ce1616878c7..ad143ff2f58 100644 --- a/erpnext/public/js/utils/sales_common.js +++ b/erpnext/public/js/utils/sales_common.js @@ -78,7 +78,7 @@ erpnext.sales_common = { 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: customer, has_variants: 0} + filters: { is_sales_item: 1, customer: customer, has_variants: 0 }, }; }); } -- GitLab From cb945a7fdd5e0b5ab9868a846ecfe4b8120ab568 Mon Sep 17 00:00:00 2001 From: Corentin Forler <8860073-cforler_dokos@users.noreply.gitlab.com> Date: Tue, 8 Apr 2025 15:28:27 +0200 Subject: [PATCH 4/4] chore: fmt --- erpnext/public/js/utils/sales_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js index ad143ff2f58..008d94264e9 100644 --- a/erpnext/public/js/utils/sales_common.js +++ b/erpnext/public/js/utils/sales_common.js @@ -75,7 +75,7 @@ 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; + 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: customer, has_variants: 0 }, -- GitLab