From 2d0fd9f519cd9478f6942d60a5b6174356228b69 Mon Sep 17 00:00:00 2001 From: Himanshu Date: Mon, 1 Jul 2019 10:24:02 +0530 Subject: [PATCH 1/2] fix: travis (#18116) --- .../doctype/service_level_agreement/service_level_agreement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py index 3b06d16a5e..82c0ffb65c 100644 --- a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py +++ b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py @@ -18,7 +18,7 @@ class ServiceLevelAgreement(Document): if self.start_date >= self.end_date: frappe.throw(_("Start Date of Agreement can't be greater than or equal to End Date.")) - if self.end_date < frappe.utils.nowdate(): + if self.end_date < frappe.utils.getdate(): frappe.throw(_("End Date of Agreement can't be less than today.")) if self.entity_type and self.entity: From 2fa6224f8fdd9fbd038c299112c9e7b857262040 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 1 Jul 2019 11:54:11 +0530 Subject: [PATCH 2/2] fix: accounts receivable / payable not working if the company is not seletced in filter --- .../accounts/report/accounts_payable/accounts_payable.js | 1 + .../report/accounts_receivable/accounts_receivable.js | 1 + .../report/accounts_receivable/accounts_receivable.py | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index 9560b2a23d..70f193e787 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -8,6 +8,7 @@ frappe.query_reports["Accounts Payable"] = { "label": __("Company"), "fieldtype": "Link", "options": "Company", + "reqd": 1, "default": frappe.defaults.get_user_default("Company") }, { diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index 27c7993f4d..3661afe797 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -8,6 +8,7 @@ frappe.query_reports["Accounts Receivable"] = { "label": __("Company"), "fieldtype": "Link", "options": "Company", + "reqd": 1, "default": frappe.defaults.get_user_default("Company") }, { diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 7127663938..f0769f68c9 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -541,10 +541,11 @@ class ReceivablePayableReport(object): conditions.append("""cost_center in (select name from `tabCost Center` where lft >= {0} and rgt <= {1})""".format(lft, rgt)) - accounts = [d.name for d in frappe.get_all("Account", - filters={"account_type": account_type, "company": self.filters.company})] - conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts))) - values += accounts + if self.filters.company: + accounts = [d.name for d in frappe.get_all("Account", + filters={"account_type": account_type, "company": self.filters.company})] + conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts))) + values += accounts return " and ".join(conditions), values