Thank you @root13F for really helpful answer. I looked at linked topic and it pushed me forward. But question is, if I have to write my own autoname function when it is already there and only thing I need is to activate it by setting autoname to “naming_series:”. What should I do to have it activated by my custom app? Shall I add project.json file with content like this? Will it override default settings? And where to put it?
{
“autoname”: “naming_series:”
}
I wanted to test it, but I was not able to install my custom app. I got an error when I was installing my custom app, even without project doctype modification, only with customizations exported by export-fixtures.
These are steps what I followed:
I started with erpnext installation with some customization via customize form and also with some data already entered.
- created an app - bench new-app myapp
- added fixtures = [¨Custom Field¨, ¨Property Setter¨] to hooks.py
- bench --site site1.local install-app myapp
- with bench export-fixtures succesfully exported customizations
- made fresh install of erpnext on another virtual machine
- copied myapp directory to app directory on machine created in step 6
- ran bench --site site1.local install-app myapp and got this error.
What I did wrong?
frappe@ubusrv16:~/frappe-bench$ bench --site site1.local install-app myapp
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, 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/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/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 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 162, in install_app
frappe.init(site=site)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 135, in init
local.conf = _dict(get_site_config())
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 189, in get_site_config
config.update(get_file_json(site_config))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 896, in get_file_json
return json.load(f)
File “/usr/lib/python2.7/json/init.py”, line 291, in load
**kw)
File “/usr/lib/python2.7/json/init.py”, line 339, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/decoder.py”, line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python2.7/json/decoder.py”, line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 4 column 21 (char 91)