Merge pull request #2560 from neilLasrado/test-fix
opportunity - test records fixed
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index a2ed86d..a546799 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -149,7 +149,7 @@
if not account_map:
frappe.throw(_("No Customer Accounts found."))
else:
- accounts_list = ['"{0}"'.format(ac.replace('"', '\"')) for ac in account_map]
+ accounts_list = ["'{0}'".format(frappe.db.escape(ac)) for ac in account_map]
conditions.append("account in ({0})".format(", ".join(accounts_list)))
return " and ".join(conditions), values
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 754a7d8..1535575 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -245,7 +245,7 @@
for entry in expected_gle:
for e in existing_gle:
if entry.account==e.account and entry.against_account==e.against_account \
- and entry.cost_center==e.cost_center \
+ and (not entry.cost_center or not e.cost_center or entry.cost_center==e.cost_center) \
and (entry.debit != e.debit or entry.credit != e.credit):
matched = False
break