Account None not found Purchase Invoice

Account None not found
The resource you are looking for is not available when submit a purchase invoice.

ERPNext: v13.0.0-beta.12 (version-13-beta)
Frappe Framework: v13.0.0-beta.11 (version-13-beta)

Traceback : Account None not found while submitting PI

Traceback (most recent call last):
File “/home/frappe/erpnext/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 918, in submit
self._submit()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 907, in _submit
self.save()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 285, in save
return self._save(*args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 337, in _save
self.run_post_save_methods()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 986, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 848, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 1137, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 1120, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 842, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/erpnext/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py”, line 411, in on_submit
self.make_gl_entries()
File “/home/frappe/erpnext/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py”, line 427, in make_gl_entries
make_gl_entries(gl_entries, update_outstanding=update_outstanding, merge_entries=False, from_repost=from_repost)
File “/home/frappe/erpnext/apps/erpnext/erpnext/accounts/general_ledger.py”, line 20, in make_gl_entries
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
File “/home/frappe/erpnext/apps/erpnext/erpnext/accounts/general_ledger.py”, line 130, in save_entries
make_entry(entry, adv_adj, update_outstanding, from_repost)
File “/home/frappe/erpnext/apps/erpnext/erpnext/accounts/general_ledger.py”, line 139, in make_entry
gle.submit()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 918, in submit
self._submit()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 907, in _submit
self.save()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 285, in save
return self.save(*args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 307, in save
self.insert()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 238, in insert
self.run_before_save_methods()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 953, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 848, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 1137, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 1120, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 842, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/erpnext/apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py”, line 31, in validate
self.pl_must_have_cost_center()
File “/home/frappe/erpnext/apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py”, line 76, in pl_must_have_cost_center
if frappe.get_cached_value(“Account”, self.account, “report_type”) == “Profit and Loss”:
File “/home/frappe/erpnext/apps/frappe/frappe/init.py”, line 779, in get_cached_value
doc = get_cached_doc(doctype, name)
File “/home/frappe/erpnext/apps/frappe/frappe/init.py”, line 764, in get_cached_doc
doc = get_doc(*args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/init.py”, line 807, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 75, in get_doc
return controller(*args, **kwargs)
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 113, in init
self.load_from_db()
File “/home/frappe/erpnext/apps/frappe/frappe/model/document.py”, line 156, in load_from_db
frappe.throw(
("{0} {1} not found").format(
(self.doctype), self.name), frappe.DoesNotExistError)
File “/home/frappe/erpnext/apps/frappe/frappe/init.py”, line 411, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “/home/frappe/erpnext/apps/frappe/frappe/init.py”, line 390, in msgprint
_raise_exception()
File “/home/frappe/erpnext/apps/frappe/frappe/init.py”, line 344, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: Account None not found

Thanks to @Kaviya_Periyasamy, Resolved by setting up Expense Account at ITEM Edit in Purchaes Invoice.

1 Like