Try ERPNext Buy Support Partners Foundation

frappe.exceptions.ValidationError: Either location or employee must be required erpnext.demo.demo.make

I am facing issue while getting dummy data for demo erpnext site.

frappe.exceptions.ValidationError: Either location or employee must be required

I am using command bench make-demo --site site_name and bench --site execute erpnext.demo.demo.make

Welcome to ERPNext mahekumarshrma

What an excellent idea here -

frappe.exceptions.ValidationError: Either location or employee must be required

To debug this demo setup please copy and paste the complete traceback here thanks!

Hi @clarkej, Please find below the taceback.

Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/commands/init.py”, line 45, in make_demo
demo.make(domain, days)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/demo.py”, line 31, in make
manufacture.setup_data()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/manufacture.py”, line 15, in setup_data
setup_asset()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/demo/setup/manufacture.py”, line 63, in setup_asset
asset.submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 864, in submit
self._submit()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 853, in _submit
self.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 273, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 326, in save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 927, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 794, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1064, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1047, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 788, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/assets/doctype/asset/asset.py”, line 33, in on_submit
self.make_asset_movement()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/assets/doctype/asset/asset.py”, line 156, in make_asset_movement
‘reference_name’: reference_docname
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 230, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 893, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 794, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1064, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1047, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 788, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_movement/asset_movement.py”, line 12, in validate
self.validate_asset()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_movement/asset_movement.py”, line 26, in validate_asset
frappe.throw(
(“Either location or employee must be required”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 377, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 356, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Either location or employee must be required

This is dated but nonetheless may give you clues to try 'bench run-tests' to make local instance like demo.erpnext.com?

The idea is to update and fix the setup to overcome issues like validation exceptions…