Problem in Upgrade [Issue in Patch]

Hi, when I update to the latest version I’ve facing an error in the follow patch rename_translated_domains_in_en.py

I think there is an error in the follow line:
https://github.com/frappe/erpnext/blob/develop/erpnext/patches/v9_2/rename_translated_domains_in_en.py#L16

It should be:
frappe.rename_doc("Domain", domain, translated_domain, ignore_permissions=True, merge=True)

1 Like

Hi,
I have had the same issue

Executing erpnext.patches.v9_2.rename_translated_domains_in_en in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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 <module>
    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 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, 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 217, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v9_2/rename_translated_domains_in_en.py", line 16, in execute
    frappe.rename_doc("Domain", translated_domain, domain, ignore_permissions=True, merge=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 696, in rename_doc
    return rename_doc(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 39, in rename_doc
    new = validate_rename(doctype, new, meta, merge, force, ignore_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 117, in validate_rename
    frappe.msgprint(_("{0} {1} does not exist, select a new target to merge").format(doctype, new), raise_exception=1)
  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 284, in _raise_exception
    raise ValidationError(encode(msg))
frappe.exceptions.ValidationError: Domain Manufacturing n'existe pas, veuillez sélectionner une nouvelle cible à fusionner

I’m in french locale FYI.
thanks federico_calvo, I would never have found the fix alone :slight_smile:

I have same problem migrating . @federico_calvo do you have solution?

@Giuseppe_Lamatrice

The solution is descripted in the post.
You should edit the rename_translated_domains_in_en.py file in the Line 16 as was explain

I described my “solution” on [Patch Error] Executing erpnext.patches.v9_2.rename_translated_domains_in_en in site1.local · Issue #11879 · frappe/erpnext · GitHub
Today @saurabh6790 has fixed this patch.

1 Like

I bypassed error deleting patch (I know that is not best practice). Today I upgraded ERPNext and this patch generate same error.