From d97b6d38ef732205f8de17dcb01d90ea1f5120fa 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 --- 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 e900b81d4b..a1952786d8 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -14,6 +14,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 e3bd8d10b0a99fca326c7252063ef11b3665d3cf 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 --- .../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 a1952786d8..e6a0e2a6ea 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -13,26 +13,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 e6949d71f628a15ea87ee143d09dce47b66f0e02 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 --- 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 e6a0e2a6ea..ef1f6bd8d8 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -13,6 +13,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();