Erpnext production version gives error : ImportError: Module import failed for Purchase Order (erpnext.buying.doctype.purchase_order.purchase_order Error: cannot import name 'get_item_defaults')

Hi All,

All of a sudden my production version since morning started to prompt server error following is the error trace, please let me know if there is any issue.

App Versions

	"erpnext": "13.26.0",
	"frappe": "13.26.0"


List/Purchase Order/List


Traceback (most recent call last):
  File "apps/frappe/frappe/modules/", line 205, in load_doctype_module
    doctype_python_modules[key] = frappe.get_module(module_name)
  File "apps/frappe/frappe/", line 980, in get_module
    return importlib.import_module(modulename)
  File "env/lib/python3.6/importlib/", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "apps/erpnext/erpnext/buying/doctype/purchase_order/", line 13, in <module>
    from erpnext.accounts.doctype.sales_invoice.sales_invoice import (
  File "apps/erpnext/erpnext/accounts/doctype/sales_invoice/", line 41, in <module>
    from erpnext.controllers.accounts_controller import validate_account_head
  File "apps/erpnext/erpnext/controllers/", line 30, in <module>
    from erpnext.accounts.doctype.pricing_rule.utils import (
  File "apps/erpnext/erpnext/accounts/doctype/pricing_rule/", line 16, in <module>
    from erpnext.stock.get_item_details import get_conversion_factor
  File "apps/erpnext/erpnext/stock/", line 22, in <module>
    from erpnext.stock.doctype.item.item import get_item_defaults, get_uom_conv_factor
ImportError: cannot import name 'get_item_defaults'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/", line 68, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/", line 31, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/", line 68, in execute_cmd
    return, **frappe.form_dict)
  File "apps/frappe/frappe/", line 1213, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/", line 71, in getdoctype
    docs = get_meta_bundle(doctype)
  File "apps/frappe/frappe/desk/form/", line 81, in get_meta_bundle
    bundle = [frappe.desk.form.meta.get_meta(doctype)]
  File "apps/frappe/frappe/desk/form/", line 35, in get_meta
    meta = FormMeta(doctype)
  File "apps/frappe/frappe/desk/form/", line 48, in __init__
  File "apps/frappe/frappe/desk/form/", line 68, in load_assets
  File "apps/frappe/frappe/desk/form/", line 209, in load_templates
    module = load_doctype_module(
  File "apps/frappe/frappe/modules/", line 207, in load_doctype_module
    raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Purchase Order (erpnext.buying.doctype.purchase_order.purchase_order Error: cannot import name 'get_item_defaults')

Request Data

	"type": "GET",
	"args": {
		"doctype": "Purchase Order",
		"with_parent": 1,
		"cached_timestamp": null
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.load.getdoctype"

Response Data

	"exception": "ImportError: Module import failed for Purchase Order (erpnext.buying.doctype.purchase_order.purchase_order Error: cannot import name 'get_item_defaults')"