ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Custom Report on Child Table


#1

Hi everyone,

I would like to create a report on a child table (e.g. Packing Slip Item)

The scenario is that I would like to have a different view of the packing slip. I would like to have an aggregation which tells me for today, how many quantity for a particular product are to be packed. That is in contrast with the Packing Slip report which give you a line for each product and each packing slip ID, so you can imagine there can be multiple rows for a particular product.

What I have done is to go into report builder and choose “Ref DocType” as “Packing Slip Item”. However, upon saving, there is an error.

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 283, in _save
self.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 215, in insert
self.run_method(“before_insert”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py”, line 43, in before_insert
self.set_doctype_roles()
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/report/report.py”, line 54, in set_doctype_roles
roles = [{‘role’: d.role} for d in meta.permissions if d.permlevel==0]
AttributeError: ‘Meta’ object has no attribute ‘permissions’

I have no issue using report builder on Packing Slip doctype.

Is it because we can’t do report on child tables? If yes, what other way can I do report on child tables?

Thank you!


#2

Have you tried Query Report or Script Report ?