Hi Guys, I and my colleague is getting “TypeError: ‘NoneType’ object is not iterable” while creating a Purchase Receipt.
We updated the system to the latest built last night however it is still the same.
He tried to create a subcontract according to the tutorial video (https://frappe.github.io/erpnext/user/manual/en/manufacturing/subcontracting). The BOM, PO, and Material Transfer worked well. However, when trying to submit the Purchase Receipt, the error occurred. He has tried the whole process multiple times, each with the same result.
The error log is as follows-
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 741, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 730, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 280, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 793, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 887, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 660, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py”, line 135, in on_submit
self.make_gl_entries()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 30, in make_gl_entries
make_gl_entries(gl_entries, from_repost=from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 19, in make_gl_entries
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 88, in save_entries
make_entry(entry, adv_adj, update_outstanding, from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 99, in make_entry
gle.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 192, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 887, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 660, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py”, line 27, in validate
self.validate_currency()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py”, line 119, in validate_currency
account_currency = get_account_currency(self.account)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/account.py”, line 233, in get_account_currency
return frappe.local_cache(“account_currency”, account, generator)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1291, in local_cache
local.cache[namespace][key] = generator()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/account.py”, line 227, in generator
account_currency, company = frappe.db.get_value(“Account”, account, [“account_currency”, “company”])
TypeError: ‘NoneType’ object is not iterable
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 920, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 741, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 730, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 280, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 793, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 887, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 660, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py”, line 135, in on_submit
self.make_gl_entries()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/stock_controller.py”, line 30, in make_gl_entries
make_gl_entries(gl_entries, from_repost=from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 19, in make_gl_entries
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 88, in save_entries
make_entry(entry, adv_adj, update_outstanding, from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/general_ledger.py”, line 99, in make_entry
gle.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 192, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 887, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 660, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py”, line 27, in validate
self.validate_currency()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py”, line 119, in validate_currency
account_currency = get_account_currency(self.account)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/account.py”, line 233, in get_account_currency
return frappe.local_cache(“account_currency”, account, generator)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1291, in local_cache
local.cache[namespace][key] = generator()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/account.py”, line 227, in generator
account_currency, company = frappe.db.get_value(“Account”, account, [“account_currency”, “company”])
TypeError: ‘NoneType’ object is not iterable
Thanks for your time and effort.