11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/app.py”, line 55, in application
11:41:06 web.1 | response = frappe.handler.handle()
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/handler.py”, line 21, in handle
11:41:06 web.1 | data = execute_cmd(cmd)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
11:41:06 web.1 | return frappe.call(method, **frappe.form_dict)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/init.py”, line 907, in call
11:41:06 web.1 | return fn(*args, **newargs)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/handler.py”, line 80, in runserverobj
11:41:06 web.1 | frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/desk/form/run_method.py”, line 35, in runserverobj
11:41:06 web.1 | r = doc.run_method(method)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
11:41:06 web.1 | out = Document.hook(fn)(self, *args, **kwargs)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/model/document.py”, line 892, in composer
11:41:06 web.1 | return composed(self, method, *args, **kwargs)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/model/document.py”, line 875, in runner
11:41:06 web.1 | add_to_return_value(self, fn(self, *args, **kwargs))
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/frappe/frappe/model/document.py”, line 661, in
11:41:06 web.1 | fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
11:41:06 web.1 | File “/home/spoojary/factory-bench/apps/corrugation/corrugation/corrugation/doctype/cm_box_description/cm_box_description.py”, line 20, in populate_raw_materals
11:41:06 web.1 | if len(self.item_papers) == 0:
11:41:06 web.1 | AttributeError: ‘CMBoxDescription’ object has no attribute ‘item_papers’
I thought it won’t be of much use as it is in a custom app. After doing some more experimentation, it looks like the child table attribute is getting added some time later in the object lifecycle. When I was getting the error, I was making the call from javascript onload() function. The document is still local at that stage, however I could see all the attributes except the child table from server side(python script). Then I moved the call from javascript onload() to start of python on_update(). During that time, the object has all the attributes including child table. So looks like the attributes are getting added somewhere in the middle. What I am really looking for is some information on this mapping(doctype to Object and DB Table) and troubleshooting tips.