Second company PI: TypeError: 'NoneType' object is not iterable

Hi, I can;t submit any PI from my second company. It says TypeError: ‘NoneType’ object is not iterable.
Everything is fine with the first company. they are both sister companies under one company. for some reason I can’t submit any Purchase Invoices.

Help the community troubleshoot by

  1. copy-paste your browser console output (google it)
  2. indicate which ERPNext and Frappe version you’re using (ERPNext User Icon > Help)
  3. Did you do any customizations?
1 Like

Thanks a lot mate.
3- No
2- I’m on the latest version so : v13.16.0 (version-13)

Traceback (most recent call last):
File “/home/erp/frappe-bench/apps/frappe/frappe/”, line 68, in application
response = frappe.api.handle()
File “/home/erp/frappe-bench/apps/frappe/frappe/”, line 55, in handle
return frappe.handler.handle()
File “/home/erp/frappe-bench/apps/frappe/frappe/”, line 31, in handle
data = execute_cmd(cmd)
File “/home/erp/frappe-bench/apps/frappe/frappe/”, line 67, in execute_cmd
return, **frappe.form_dict)
File “/home/erp/frappe-bench/apps/frappe/frappe/”, line 1208, in call
return fn(*args, **newargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/desk/form/”, line 19, in savedocs
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 936, in submit
return self._submit()
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 919, in _submit
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 285, in save
return self._save(*args, **kwargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 337, in _save
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 1004, in run_post_save_methods
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 860, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 1158, in composer
return composed(self, method, *args, **kwargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 1141, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/erp/frappe-bench/apps/frappe/frappe/model/”, line 854, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/erp/frappe-bench/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/”, line 428, in on_submit
File “/home/erp/frappe-bench/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/”, line 1166, in update_advance_tax_references
for tax in self.get(‘advance_tax’):
TypeError: ‘NoneType’ object is not iterable

1 Like

Is it this self.get(‘advance_tax’):?
Ran a redundant update it solved the issue

Fixed via fix: Error on Invoice generation by deepeshgarg007 · Pull Request #28791 · frappe/erpnext · GitHub

1 Like