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)
1-

Traceback (most recent call last):
File “/home/erp/frappe-bench/apps/frappe/frappe/app.py”, line 68, in application
response = frappe.api.handle()
File “/home/erp/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/erp/frappe-bench/apps/frappe/frappe/handler.py”, line 31, in handle
data = execute_cmd(cmd)
File “/home/erp/frappe-bench/apps/frappe/frappe/handler.py”, line 67, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/erp/frappe-bench/apps/frappe/frappe/init.py”, line 1208, in call
return fn(*args, **newargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 936, in submit
return self._submit()
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 919, in _submit
return self.save()
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 285, in save
return self._save(*args, **kwargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 337, in _save
self.run_post_save_methods()
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 1004, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 860, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 1158, in composer
return composed(self, method, *args, **kwargs)
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, line 1141, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/erp/frappe-bench/apps/frappe/frappe/model/document.py”, 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/purchase_invoice.py”, line 428, in on_submit
self.update_advance_tax_references()
File “/home/erp/frappe-bench/apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py”, 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 https://github.com/frappe/erpnext/pull/28791

1 Like