Hello Guys,
I am again having some issue using REST API to create objects. Now I am not being able to create a BOM. Here’s the data I am passing in the body:
data={“name”:“BOM-TestBOMRest-001”,“items”:[{“qty”:1,“item_code”:“074-0065-001”}],“item”:“PN000001-001”,“doctype”:“BOM”, “rm_cost_as_per”: “Valuation Rate”}"
I am getting the following error:
AttributeError: 'NoneType' object has no attribute 'options'
Any idea of what I am missing?
Cheers
Ewerton
this means that your trying to access a None with attribute options. You need to find somewhere in your variables who’s trying to access “options”. Also it would be better if you can show the full traceback
Thanks John, I am using the standard cloud instance so I think it might be some mandatory field I am missing. Here is the error stack.
Traceback (most recent call last):
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/app.py", line 60, in application
response = frappe.api.handle()
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/api.py", line 120, in handle
"data": frappe.get_doc(data).insert().as_dict()
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/__init__.py", line 596, in get_doc
return frappe.model.document.get_doc(arg1, arg2)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/document.py", line 50, in get_doc
return controller(arg1, arg2)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/website/website_generator.py", line 21, in __init__
super(WebsiteGenerator, self).__init__(*args, **kwargs)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/document.py", line 86, in __init__
super(Document, self).__init__(arg1)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/base_document.py", line 52, in __init__
self.update(d)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/base_document.py", line 75, in update
self.set(key, value)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/base_document.py", line 122, in set
self.extend(key, value)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/base_document.py", line 148, in extend
self.append(key, v)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/base_document.py", line 136, in append
value = self._init_child(value, key)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/base_document.py", line 160, in _init_child
value["doctype"] = self.get_table_field_doctype(key)
File "/home/frappe/benches/bench-2017-02-22/apps/frappe/frappe/model/base_document.py", line 271, in get_table_field_doctype
return self.meta.get_field(fieldname).options
AttributeError: 'NoneType' object has no attribute 'options'