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

Error: os.path.join(frappe.get_pymodule_path(app), “translations”, lang + “.csv”)


#1

Hi

I am in the process of creating doc type as follows;

Doc Type A - Field 1

Doc Type B - Field 2
- Field 1 (Of Doc Type A)

I was able to create Doc Type A and am able to use it , however while i am creating doc type B and i am selecting Field 1 of Doc Type A in Doc Type B as ‘Link’ it gives me an error as follows

Server Error: Please check your server logs or contact tech support.

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 296, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 71, in validate
validate_fields(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 725, in validate_fields
check_link_table_options(meta.get(“name”), d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 514, in check_link_table_options
frappe.throw(
("{0}: Options {1} must be the same as doctype name {2} for the field {3}", DoctypeLinkError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 71, in _
return get_full_dict(lang).get(msg) or non_translated_msg
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 190, in get_full_dict
frappe.local.lang_full_dict = load_lang(lang)
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 215, in load_lang
path = os.path.join(frappe.get_pymodule_path(app), “translations”, lang + “.csv”)
TypeError: unsupported operand type(s) for +: ‘type’ and ‘unicode’

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 296, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 71, in validate
validate_fields(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 725, in validate_fields
check_link_table_options(meta.get(“name”), d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 514, in check_link_table_options
frappe.throw(
("{0}: Options {1} must be the same as doctype name {2} for the field {3}", DoctypeLinkError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 71, in _
return get_full_dict(lang).get(msg) or non_translated_msg
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 190, in get_full_dict
frappe.local.lang_full_dict = load_lang(lang)
File “/home/frappe/frappe-bench/apps/frappe/frappe/translate.py”, line 215, in load_lang
path = os.path.join(frappe.get_pymodule_path(app), “translations”, lang + “.csv”)
TypeError: unsupported operand type(s) for +: ‘type’ and ‘unicode’

Any inputs what mistakes i am doing here ?

Also I would really want to know how to analyze and understand such error description so that i can understand the root cause of the error , Please guide me to any documentation in this regards.

Tx