Hi
I have worked on a script that takes the GST sales register from ERPNext and converts it to the json format required by GSTR1. While this seems to work, I don’t know how this can be integrated in erpnext as I am very new to erpnext. So I tried installing one with backup from our site
This failed while running ‘bench migrate’ followed by ‘bench restore’
Here is the error I got
frappe.exceptions.LinkValidationError Could not find Document: Employee
Tax Exemption Proof Submission
After searching some of the existing errors, I tried switching to develop and also started from scratch. But nothing helped. Then I manually commented out the said patch
Executing erpnext.patches.v10_0.added_extra_gst_custom_field in shree.in
(5efa767cad453a80)
and it worked. Now I don’t know whether that would create issues as I have stopped some patches from working. Could someone please help in restoring the backup without this issue?
Detailed error from ‘bench update --patch’ as well as ‘bench migrate’
…
Success: Done in 0.444s
Executing erpnext.patches.v10_0.update_assessment_result in shree.in
(5efa767cad453a80)
Success: Done in 0.383s
Executing erpnext.patches.v10_0.added_extra_gst_custom_field in shree.in
(5efa767cad453a80)
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/harshith/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”,
line 97, in
main()
File
“/home/harshith/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”,
line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File
“/home/harshith/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”,
line 722, in call
return self.main(*args, **kwargs)
File
“/home/harshith/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”,
line 697, in main
rv = self.invoke(ctx)
File
“/home/harshith/frappe-bench/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/harshith/frappe-bench/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/harshith/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”,
line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File
“/home/harshith/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”,
line 535, in invoke
return callback(*args, **kwargs)
File
“/home/harshith/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/harshith/frappe-bench/apps/frappe/frappe/commands/init.py”,
line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File
“/home/harshith/frappe-bench/apps/frappe/frappe/commands/site.py”, line
222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/harshith/frappe-bench/apps/frappe/frappe/migrate.py”,
line 39, in migrate
frappe.modules.patch_handler.run_all()
File
“/home/harshith/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”,
line 29, in run_all
if not run_single(patchmodule = patch):
File
“/home/harshith/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”,
line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File
“/home/harshith/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”,
line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File
“/home/harshith/frappe-bench/apps/erpnext/erpnext/patches/v10_0/added_extra_gst_custom_field.py”,
line 9, in execute
make_custom_fields(update=False)
File
“/home/harshith/frappe-bench/apps/erpnext/erpnext/regional/india/setup.py”,
line 244, in make_custom_fields
create_custom_fields(custom_fields, ignore_validate =
frappe.flags.in_patch, update=update)
File
“/home/harshith/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py”,
line 133, in create_custom_fields
create_custom_field(doctype, df, ignore_validate=ignore_validate)
File
“/home/harshith/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py”,
line 118, in create_custom_field
custom_field.insert()
File
“/home/harshith/frappe-bench/apps/frappe/frappe/model/document.py”, line
221, in insert
self._validate_links()
File
“/home/harshith/frappe-bench/apps/frappe/frappe/model/document.py”, line
734, in _validate_links
frappe.LinkValidationError)
File “/home/harshith/frappe-bench/apps/frappe/frappe/init.py”,
line 327, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/harshith/frappe-bench/apps/frappe/frappe/init.py”,
line 313, in msgprint
_raise_exception()
File “/home/harshith/frappe-bench/apps/frappe/frappe/init.py”,
line 286, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.LinkValidationError: Could not find Document: Employee
Tax Exemption Proof Submission