frappe/frappe#478, frappe tests pass, .txt renamed to .json
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 4801c75..2d54b74 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -5,7 +5,6 @@
import frappe
from frappe import _, throw
from frappe.utils import flt, cint, today, cstr
-from frappe.model.code import get_obj
from erpnext.setup.utils import get_company_currency
from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year
from erpnext.utilities.transaction_base import TransactionBase
@@ -481,7 +480,7 @@
total_outstanding = total_outstanding[0][0] if total_outstanding else 0
if total_outstanding:
- get_obj('Account', account).check_credit_limit(total_outstanding)
+ frappe.get_doc('Account', account).check_credit_limit(total_outstanding)
@frappe.whitelist()
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index dee9833..24c5db1 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -262,8 +262,7 @@
/ ref_doc_qty)*100
frappe.db.set_value(ref_dt, ref_dn, "per_billed", per_billed)
- from frappe.model.meta import has_field
- if has_field(ref_dt, "billing_status"):
+ if frappe.get_meta(ref_dt).get_field("billing_status"):
if per_billed < 0.001: billing_status = "Not Billed"
elif per_billed >= 99.99: billing_status = "Fully Billed"
else: billing_status = "Partly Billed"
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 3ff780d..a24834e 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -131,7 +131,7 @@
warehouse_account = self.get_warehouse_account()
for voucher_type, voucher_no in future_stock_vouchers:
existing_gle = gle.get((voucher_type, voucher_no), [])
- voucher_obj = frappe.get_obj(voucher_type, voucher_no)
+ voucher_obj = frappe.get_doc(voucher_type, voucher_no)
expected_gle = voucher_obj.get_gl_entries(warehouse_account)
if expected_gle:
matched = True
@@ -276,7 +276,7 @@
for voucher_type, voucher_no in future_stock_vouchers:
existing_gle = gle.get((voucher_type, voucher_no), [])
- voucher_obj = frappe.get_obj(voucher_type, voucher_no)
+ voucher_obj = frappe.get_doc(voucher_type, voucher_no)
expected_gle = voucher_obj.get_gl_entries(warehouse_account)
if expected_gle:
if not existing_gle or not compare_existing_and_expected_gle(existing_gle,