Demo instance creation on Master fails


When I created a demo instance on a master branch instance of ERPnext it failed while loading the BOM . Call stack was as follows
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/commands/”, line 45, in make_demo
demo.make(domain, days)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/”, line 31, in make
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/”, line 19, in setup_data
import_json(‘BOM’, submit=True)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/”, line 418, in import_json
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 228, in insert
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 886, in run_before_save_methods
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 786, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1055, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1038, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 780, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom/”, line 58, in validate
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/bom/”, line 582, in validate_operations
if not d.batch_size > 0:
TypeError: ‘>’ not supported between instances of ‘NoneType’ and ‘int’

Any reasons ? Should I raise a bug ?


Yes, please create a GitHub issue here

Thanks Jai.

I’ve raised an issue - Error in loading demo data · Issue #18883 · frappe/erpnext · GitHub

Also as I was moving forward in loading the demo I was getting other issues

  1. Asset scrap/sale was failing because “Finance Book” was not there . Commented the steps to move forward
  2. Subsequently had issues in projects.run_projects(current_date) while running the simulation. Commented again to move forward
  3. In a subsequent simulation cycle it failed on

I’d have a go at analyzing the issues, but as a recent user had a couple of questions

  1. Am I doing it right ? Are others also facing the issue ? I’m doing a make demo after a vanilla install of version 12.
  2. Is the demo framework/solution used / useful enough for these issues to be fixed ?