Purchase receipt submit error

Hi
Iam not able Submit a Purchase Reciept
I get the following error


Please help on this
Regards
Hemanth

Hi, please copy the trace back and post it here so that we can read it in full

Hi
This is the error i get

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 1284, 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 913, 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 1284, 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

Please help
Its very critical
Regards
Hemanth

Hi @krishnanhemanth
The error has to do with your company currency. Are you doing anything exotic with your company currency? What is your company currency? What currency is the invoice being made?

Hi tundebabzy
Thanks for the tip
I am using INR as my currency throughout erpnext
i donot use multicurrency at all
Thanks again
Hemanth

Rechecked all my currency settings
everything seems to be fine
is it by any chance a bug
Regards
Hemanth

Can anybody help me on this
Iam Stuck really bad
all of my documentation is pending
Thanks
Hemanth

Please create an issue on github and let’s pick it up from there. Add the traceback, the version of erpnext and frappe you are using.

Hi
on further testing around , i came accross this
there is just one warehouse account where the purchase reciept submits without any error
rest all my warehouse account throws up the error
any inputs on this
regards
Hemanth

1 Like

Please Help

after doing a lot of testing with data,
i have around 16 accounts under stock assets >>All Warehouses
of the 16, in one account i am able to create Purchase Reciept without any error
but all the remianing 15 accounts throws up the above error
not able to figure out whats wrong
any inputs please

Hi @krishnanhemanth
I’ll try to reproduce this issue today

Hi tundebabzy
Thanks a lot
I have literally hit a wall
not able to continue
without purchase reciept, i cannot make entry for rejected items
Thanks again
regards
Hemanth

The Po invoice generation is ok