From ab1c43dbee9683126a8bcbff8f0044f34aab4a3a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 13:41:25 +0530 Subject: [PATCH 1/3] fix: To allow creation of sales invoice without customer --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 06e1e58008f..993ee5c6542 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -1166,6 +1166,9 @@ class SalesInvoice(SellingController): self.set_missing_values(for_validate = True) def validate_inter_company_party(doctype, party, company, inter_company_reference): + if not party: + return + if doctype in ["Sales Invoice", "Sales Order"]: partytype, ref_partytype, internal = "Customer", "Supplier", "is_internal_customer" From b90fc7fc0d677c660f167db79c69647feda45f98 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 13:42:11 +0530 Subject: [PATCH 2/3] fix: Get bank account on selection of payment mode in Loan --- erpnext/hr/doctype/loan/loan.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/erpnext/hr/doctype/loan/loan.js b/erpnext/hr/doctype/loan/loan.js index 7140bea2704..e1b41786f47 100644 --- a/erpnext/hr/doctype/loan/loan.js +++ b/erpnext/hr/doctype/loan/loan.js @@ -172,18 +172,20 @@ frappe.ui.form.on('Loan', { }, mode_of_payment: function (frm) { - frappe.call({ - method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account", - args: { - "mode_of_payment": frm.doc.mode_of_payment, - "company": frm.doc.company - }, - callback: function (r, rt) { - if (r.message) { - frm.set_value("payment_account", r.message.account); + if (frm.doc.mode_of_payment && frm.doc.company) { + frappe.call({ + method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account", + args: { + "mode_of_payment": frm.doc.mode_of_payment, + "company": frm.doc.company + }, + callback: function (r, rt) { + if (r.message) { + frm.set_value("payment_account", r.message.account); + } } - } - }); + }); + } }, loan_application: function (frm) { From 2a8c463079f6630194f9c1bd645228ef20a040c1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 13:42:55 +0530 Subject: [PATCH 3/3] fix: show tasks in project order by due date and status --- erpnext/projects/doctype/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index a66fac31c56..74e70a92766 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -65,7 +65,7 @@ class Project(Document): 'name': ("not in", self.deleted_task_list) }) - return frappe.get_all("Task", "*", filters, order_by="exp_start_date asc") + return frappe.get_all("Task", "*", filters, order_by="exp_start_date asc, status asc") def validate(self): self.validate_weights()