ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

'bench run-tests' to make local instance like demo.erpnext.com?

erpnextversion7

#21

Thanks for the help. It doesnot work
Running simulate for 4-5 times but same error
raise raise_exception(encode(msg))
frappe.exceptions.ValidationError: Row #1: Asset Chair 2 is already Fully Depreciated


#22

In that case perhaps the setup fixture code may need to be changed.

I can’t say for sure where this is located - I believe these are simply json file of (key,value) pairs.


#23

ok two thoughts to try

  1. after a make ValidationError run ‘bench reinstall’ that apparently deletes the old database instance?

  2. delete Chair 2 from asset.json? That you will find referenced here https://github.com/frappe/erpnext/blob/develop/erpnext/demo/setup/manufacture.py

frappe@erpnext:~/frappe-bench$ find . -name ‘asset.json’
./apps/erpnext/erpnext/demo/data/asset.json
./apps/erpnext/erpnext/assets/doctype/asset/asset.json


#24

I tried above steps i.e. removed Chair 2 from asset.json
Then it gave error - frappe.exceptions.ValidationError: Row #1: Asset Chair 1 is already Fully Depreciated
So i went ahead and removed Chair 1 also
Then it gave error - frappe.exceptions.ValidationError: Row #1: Asset ERPNext is already Fully Depreciated
So it appears, problem is not with items itself but with some other data
Following might be imp lines from error trace
fixed_asset.py", line 45, in make_asset_purchase_entry
purchase_invoice.py", line 72, in validate self.validate_fixed_asset()
accounts_controller.py", line 618, in validate_fixed_asset


Sample data for demo.erpnext.com and own deployments
#25

To followup, the Wind Power LLC demo code seems to work on this version

frappe@ubuntu:~/frappe-bench$ bench version
erpnext 10.1.38
frappe 10.1.36

with these two code changes:

  1. To prevent this frappe.exceptions.ValidationError: Row #1: Asset Chair 1 is already Fully Depreciated

Apply this change so those assets have instead status ‘Submitted’ (note that this hack may well violate asset depreciation - you have been warned :slight_smile:

status = "Submitted"
                    if self.journal_entry_for_scrap:
                            status = "Scrapped"
                    elif flt(self.value_after_depreciation) < flt(self.expected_value_after_useful_life):
                            status = "Fully Depreciated"
                    elif flt(self.value_after_depreciation):
                            if flt(self.value_after_depreciation) < flt(self.gross_purchase_amount):
                                    status = 'Partially Depreciated'
  1. Change this exception to a notice instead
def create_log(ss_list):
    if not ss_list:
            frappe.msgprint("There's no employee for the given criteria. Check that Salary Slips have not already been created.")
    return ss_list

You then run a ‘simulate’ cycle with this:

frappe@ubuntu:~/frappe-bench$ bench --site site1.local execute erpnext.demo.demo.simulate

whereupon this is displayed for eg
Simulating 2018-04-16: Day 6

and this exception below occurs, to end that simulate cycle. To continue, rerun the ‘simulate’ that will advance the simulation date:

File “/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/buying_controller.py”, line 457, in validate_schedule_date
frappe.throw(_(“Row #{0}: Reqd by Date cannot be before Transaction Date”).format(d.idx))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 323, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
frappe.exceptions.ValidationError: Row #1: Reqd by Date cannot be before Transaction Date

For a taste of the dataset here are some screenshots


Sample data for demo.erpnext.com and own deployments
#26

I created a new site and ran the command

bench --site demo.erpnext execute erpnext.demo.demo.make

I get following error

> ashish@ashish-Latitude-E5530-vPro:~/frappe-bench-master$ bench --site demo.erpnext execute erpnext.demo.demo.make
> Complete Setup...
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
>     "__main__", fname, loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
>     exec code in run_globals
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
>     main()
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
>     click.Group(commands=commands)(prog_name='bench')
>   File "/home/ashish/frappe-bench-master/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
>     return self.main(*args, **kwargs)
>   File "/home/ashish/frappe-bench-master/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
>     rv = self.invoke(ctx)
>   File "/home/ashish/frappe-bench-master/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
>     return _process_result(sub_ctx.command.invoke(sub_ctx))
>   File "/home/ashish/frappe-bench-master/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
>     return _process_result(sub_ctx.command.invoke(sub_ctx))
>   File "/home/ashish/frappe-bench-master/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
>     return ctx.invoke(self.callback, **ctx.params)
>   File "/home/ashish/frappe-bench-master/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
>     return callback(*args, **kwargs)
>   File "/home/ashish/frappe-bench-master/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
>     return f(get_current_context(), *args, **kwargs)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/commands/__init__.py", line 24, in _func
>     ret = f(frappe._dict(ctx.obj), *args, **kwargs)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/commands/utils.py", line 117, in execute
>     ret = frappe.get_attr(method)(*args, **kwargs)
>   File "/home/ashish/frappe-bench-master/apps/erpnext/erpnext/demo/demo.py", line 28, in make
>     setup_data.setup(domain)
>   File "/home/ashish/frappe-bench-master/apps/erpnext/erpnext/demo/setup/setup_data.py", line 15, in setup
>     setup_holiday_list()
>   File "/home/ashish/frappe-bench-master/apps/erpnext/erpnext/demo/setup/setup_data.py", line 114, in setup_holiday_list
>     frappe.set_value("Company", erpnext.get_default_company(), "default_holiday_list", holiday_list.name)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/__init__.py", line 619, in set_value
>     return frappe.client.set_value(doctype, docname, fieldname, value)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/client.py", line 121, in set_value
>     doc = frappe.get_doc(doctype, name)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/__init__.py", line 638, in get_doc
>     return frappe.model.document.get_doc(*args, **kwargs)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/model/document.py", line 68, in get_doc
>     return controller(*args, **kwargs)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/model/document.py", line 103, in __init__
>     self.load_from_db()
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/model/document.py", line 140, in load_from_db
>     frappe.throw(_("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError)
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/__init__.py", line 323, in throw
>     msgprint(msg, raise_exception=exc, title=title, indicator='red')
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/__init__.py", line 309, in msgprint
>     _raise_exception()
>   File "/home/ashish/frappe-bench-master/apps/frappe/frappe/__init__.py", line 282, in _raise_exception
>     raise raise_exception(encode(msg))
> frappe.exceptions.DoesNotExistError: Company None not found

So i checked python console and indeed the company is not there
image

So, question is how to get the demo company ‘Wind Power LLC’?!


[Mar-2017] Showing there were error during setup ERPNext
#27

I can’t say what to suggest. The same company setup problem reported here just now with revant’s wizard setup workaround [Mar-2017] Showing there were error during setup ERPNext


#28

@salman enquired

“This looks wonderful, Just curious does this data set still work on v11 ?”

It should but may require some work to restore.

This online version is rebuilt at intervals https://demo.erpnext.com/desk#query-report/General%20Ledger


#29

Tested this and it does work on fresh install of v11 without much changes,


#30

Good to know thanks!

Please whatever you can document would be a help for all - for future reference for you too perhaps :slight_smile: