From 83bf28616e33a34174ade3504dbfae8571f8e58c Mon Sep 17 00:00:00 2001 From: kunhi Date: Mon, 12 Feb 2024 12:18:37 +0400 Subject: [PATCH 1/3] fix: fetch company terms (cherry picked from commit d97b6d38ef732205f8de17dcb01d90ea1f5120fa) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 2ac7370f4ef..9bdbff25577 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -11,6 +11,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e super.setup(doc); } company() { + super.company(); erpnext.accounts.dimensions.update_dimension(this.frm, this.frm.doctype); let me = this; From 45a04943189c221a73f752257565cdd77c2f19ab Mon Sep 17 00:00:00 2001 From: kunhi Date: Tue, 13 Feb 2024 22:32:10 +0400 Subject: [PATCH 2/3] fix: no need call for company method in sales invoice js (cherry picked from commit e3bd8d10b0a99fca326c7252063ef11b3665d3cf) --- .../doctype/sales_invoice/sales_invoice.js | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 9bdbff25577..5ed26c7937d 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -10,26 +10,6 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e this.setup_posting_date_time_check(); super.setup(doc); } - company() { - super.company(); - erpnext.accounts.dimensions.update_dimension(this.frm, this.frm.doctype); - - let me = this; - if (this.frm.doc.company) { - frappe.call({ - method: - "erpnext.accounts.party.get_party_account", - args: { - party_type: 'Customer', - party: this.frm.doc.customer, - company: this.frm.doc.company - }, - callback: (response) => { - if (response) me.frm.set_value("debit_to", response.message); - }, - }); - } - } onload() { var me = this; super.onload(); From 5eaa11b9e871048c286c278ad7601ddf4ef171bc Mon Sep 17 00:00:00 2001 From: kunhi Date: Tue, 13 Feb 2024 22:49:39 +0400 Subject: [PATCH 3/3] fix: update_dimension is required and not need party account method (cherry picked from commit e6949d71f628a15ea87ee143d09dce47b66f0e02) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 5ed26c7937d..b2672424af9 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -10,6 +10,10 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e this.setup_posting_date_time_check(); super.setup(doc); } + company() { + super.company(); + erpnext.accounts.dimensions.update_dimension(this.frm, this.frm.doctype); + } onload() { var me = this; super.onload();