From fd7be5da99a134a8dec426fd25a1e3fc503cf77a Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Thu, 7 Oct 2021 13:44:33 +0200 Subject: [PATCH] feat: remove obsolete "debit_to" field --- erpnext/accounts/doctype/dunning/dunning.js | 32 +------------------ erpnext/accounts/doctype/dunning/dunning.json | 9 ------ 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/erpnext/accounts/doctype/dunning/dunning.js b/erpnext/accounts/doctype/dunning/dunning.js index e5a5e1f8a43..99b408a7a14 100644 --- a/erpnext/accounts/doctype/dunning/dunning.js +++ b/erpnext/accounts/doctype/dunning/dunning.js @@ -23,15 +23,7 @@ frappe.ui.form.on("Dunning", { } }; }); - frm.set_query("debit_to", () => { - return { - filters: { - "account_type": "Receivable", - "is_group": 0, - "company": frm.doc.company - } - }; - }); + frm.set_query("contact_person", erpnext.queries.contact_query); frm.set_query("customer_address", erpnext.queries.address_query); frm.set_query("company_address", erpnext.queries.company_address_query); @@ -113,28 +105,6 @@ frappe.ui.form.on("Dunning", { } } } - frm.trigger("set_debit_to"); - }, - set_debit_to: function(frm) { - if (frm.doc.customer && frm.doc.company) { - return frappe.call({ - method: "erpnext.accounts.party.get_party_account", - args: { - company: frm.doc.company, - party_type: "Customer", - party: frm.doc.customer, - currency: erpnext.get_currency(frm.doc.company) - }, - callback: function (r) { - if (!r.exc && r.message) { - frm.set_value("debit_to", r.message); - } - } - }); - } - }, - customer: function (frm) { - frm.trigger("set_debit_to"); }, currency: function (frm) { // this.set_dynamic_labels(); diff --git a/erpnext/accounts/doctype/dunning/dunning.json b/erpnext/accounts/doctype/dunning/dunning.json index 1dd05b77fa9..fc2ccc7e5df 100644 --- a/erpnext/accounts/doctype/dunning/dunning.json +++ b/erpnext/accounts/doctype/dunning/dunning.json @@ -54,7 +54,6 @@ "accounting_details_section", "cost_center", "income_account", - "debit_to", "amended_from" ], "fields": [ @@ -349,14 +348,6 @@ "options": "Address", "print_hide": 1 }, - { - "fieldname": "debit_to", - "fieldtype": "Link", - "label": "Debit To", - "options": "Account", - "print_hide": 1, - "reqd": 1 - }, { "fieldname": "section_break_9", "fieldtype": "Section Break",