Hello everyone,
I got AttributeError: ‘NoneType’ object has no attribute ‘options’ when i submit Purchase Return PR. How to overcome this attribute error?
Post a traceback perhaps ?
Thanks for u r reply @marination, and here comes traceback
Traceback (most recent call last):
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 19, in savedocs
doc.submit()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 868, in submit
self._submit()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 857, in _submit
self.save()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 275, in save
return self._save(*args, **kwargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 328, in _save
self.run_post_save_methods()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 931, in run_post_save_methods
self.run_method("on_submit")
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 796, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1067, in composer
return composed(self, method, *args, **kwargs)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py", line 1052, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File "/home/ubuntu/frappe-bench/apps/formulation/formulation/overrides/override_stock_pr.py", line 243, in submit_pr
gate_entry_number = create_GE(doc)
File "/home/ubuntu/frappe-bench/apps/formulation/formulation/overrides/override_stock_pr.py", line 1086, in create_GE
"qty": abs(flt(i.qty)),
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py", line 149, in append
value = self._init_child(value, key)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py", line 184, in _init_child
value["doctype"] = self.get_table_field_doctype(key)
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py", line 298, in get_table_field_doctype
return self.meta.get_field(fieldname).options
AttributeError: 'NoneType' object has no attribute 'options'
Can you maybe try to debug which field is causing this. Add a print(fieldname) above this. The last fieldname before which it breaks can be identified as problematic.
I have updated to the latest version and the problem also solved.