Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred while installing erpnext_germany: Employee: Options must be a valid DocType for field Religious Denomination in row 77 #56

Open
ThcDelux3 opened this issue Nov 9, 2024 · 8 comments

Comments

@ThcDelux3
Copy link

Issue Description

After installing a new Frappe instance with ERPNext and HRMS, I followed the steps to install the erpnext_germany app. However, I encountered an issue during or after the installation.

Steps to Reproduce

  1. Install a fresh Frappe instance with ERPNext and HRMS.
  2. Run the following command to install the erpnext_germany app:
    bench --site erp.rr.business install-app erpnext_germany
    

Expected Behavior

The erpnext_germany app should install without any errors and function as expected within the ERPNext environment.

Environment

  • Frappe Version: v15.47.1 (version-15)
  • ERPNext Version: v15.41.1 (version-15)
  • ERPNext Germany: v15.9.1 (version-15)
  • System: Ubuntu 24.04 (arm64)
  • Browser: Google Chrome Version 130.0.6723.118 (Offizieller Build) (arm64)

Logs

App erpnext already installed

Installing erpnext_germany...
An error occurred while installing erpnext_germany: Employee: Options must be a valid DocType for field Religious Denomination in row 77
Traceback with variables (most recent call last):
File "apps/frappe/frappe/commands/site.py", line 481, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {'sites': ['erp.rr.business'], 'force': False, 'verbose': False, 'profile': False}
apps = ('erpnext_germany',)
force = False
_install_app = <function install_app at 0xe324270607c0>
filelock = <function filelock at 0xe3242704a480>
exit_code = 0
site = 'erp.rr.business'
app = 'erpnext_germany'
err = WrongOptionsDoctypeLinkError('Employee: Options must be a valid DocType for field Religious Denomination in row 77')
File "apps/frappe/frappe/installer.py", line 326, in install_app
frappe.get_attr(after_install)()
name = 'erpnext_germany'
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0xe324265ed1c0>
sync_for = <function sync_for at 0xe324265edf80>
sync_customizations = <function sync_customizations at 0xe32427b69760>
sync_fixtures = <function sync_fixtures at 0xe324265ee2a0>
app_hooks = {'after_install': ['erpnext_germany.install.after_install'], 'app_color': ['grey'], 'app_description': ['App to hold regional code for Germany, built on top of ERPNext.'], 'app_email': ['hallo@alyf.de'], 'app_icon': ['octicon octicon-file-directory'], 'app_include_js': ['erpnext_germany.bundle.js'], 'app_license': ['GPLv3'], 'app_name': ['erpnext_germany'], 'app_publisher': ['ALYF GmbH'], 'app_title': ['ERPNext Germany'], 'app_version': ['15.9.1'], 'before_uninstall': ['erpnext_germany.uninstall.before_uninstall'], 'doc_events': {'Quotation': {'on_trash': ['erpnext_germany.custom.sales.on_trash']}, 'Sales Order': {'on_trash': ['erpnext_germany.custom.sales.on_trash']}, 'Sales Invoice': {'on_trash': ['erpnext_germany.custom.sales.on_trash']}}, 'germany_custom_records': [{'doctype': 'DocType Link', 'parent': 'Customer', 'parentfield': 'links', 'parenttype': 'Customize Form', 'group': 'Pre Sales', 'link_doctype': 'VAT ID Check', 'link_fieldname': 'party', 'custom': 1}, {'doctype': 'DocTyp...
installed_apps = ['frappe', 'erpnext', 'hrms']
app = 'erpnext'
required_app = 'erpnext'
after_install = 'erpnext_germany.install.after_install'
File "apps/erpnext_germany/erpnext_germany/install.py", line 13, in after_install
create_custom_fields(get_custom_fields())
File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 328, in create_custom_fields
create_custom_field(doctype, df, ignore_validate=ignore_validate)
custom_fields = {'Company': [{'fieldtype': 'Section Break', 'fieldname': 'register_sb_1', 'label': 'Register Information', 'insert_after': 'address_html', 'collapsible': 1}, {'fieldtype': 'Select', 'fieldname': 'register_type', 'label': 'Register Type', 'insert_after': 'register_sb_1', 'options': '\nHRA\nHRB\nGnR\nPR\nVR', 'translatable': 0}, {'fieldtype': 'Column Break', 'fieldname': 'register_cb_1', 'insert_after': 'register_type'}, {'fieldtype': 'Data', 'fieldname': 'register_number', 'label': 'Register Number', 'insert_after': 'register_cb_1', 'translatable': 0}, {'fieldtype': 'Column Break', 'fieldname': 'register_cb_2', 'insert_after': 'register_number'}, {'fieldtype': 'Select', 'fieldname': 'register_court', 'label': 'Register Court', 'insert_after': 'register_cb_2', 'options': '\nAachen\nAltenburg\nAmberg\nAnsbach\nApolda\nArnsberg\nArnstadt\nArnstadt Zweigstelle Ilmenau\nAschaffenburg\nAugsburg\nAurich\nBad Hersfeld\nBad Homburg v.d.H.\nBad Kreuznach\nBad Oeynhausen\nBad Salzungen\nBamberg\nB...
ignore_validate = False
update = True
doctypes_to_update = {'Company', 'Customer', 'Employee', 'Supplier'}
doctypes = ('Employee',)
fields = [{'fieldtype': 'Link', 'fieldname': 'nationality', 'label': 'Nationality', 'options': 'Country', 'insert_after': 'date_of_joining'}, {'fieldtype': 'Check', 'fieldname': 'is_severely_disabled', 'label': 'Is Severely Disabled', 'insert_after': 'nationality'}, {'fieldtype': 'Float', 'fieldname': 'working_hours_per_week', 'label': 'Working Hours Per Week', 'insert_after': 'attendance_device_id'}, {'fieldtype': 'Section Break', 'fieldname': 'employee_taxes_sb', 'label': 'Taxes', 'insert_after': 'default_shift', 'collapsible': 1}, {'fieldtype': 'Data', 'fieldname': 'tax_id', 'label': 'Tax ID', 'insert_after': 'employee_taxes_sb', 'translatable': 0}, {'fieldtype': 'Data', 'fieldname': 'tax_office', 'label': 'Tax Office', 'insert_after': 'tax_id', 'translatable': 0}, {'fieldtype': 'Data', 'fieldname': 'tax_office_number', 'label': 'Tax Office Number', 'insert_after': 'tax_office', 'translatable': 0}, {'fieldtype': 'Column Break', 'fieldname': 'employee_taxes_cb', 'insert_after': 'tax_office_nu...
doctype = 'Employee'
df = {'fieldtype': 'Link', 'fieldname': 'religious_denomination', 'label': 'Religious Denomination', 'options': 'Religious Denomination', 'insert_after': 'children_eligible_for_tax_credits', 'owner': 'Administrator'}
field = None
File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 294, in create_custom_field
custom_field.insert()
doctype = 'Employee'
df = {'fieldtype': 'Link', 'fieldname': 'religious_denomination', 'label': 'Religious Denomination', 'options': 'Religious Denomination', 'insert_after': 'children_eligible_for_tax_credits', 'owner': 'Administrator'}
ignore_validate = False
is_system_generated = True
custom_field = <CustomField: Employee-religious_denomination>
File "apps/frappe/frappe/model/document.py", line 315, in insert
self.run_post_save_methods()
self = <CustomField: Employee-religious_denomination>
ignore_permissions = None
ignore_links = None
ignore_if_duplicate = False
ignore_mandatory = None
set_name = None
set_child_names = True
File "apps/frappe/frappe/model/document.py", line 1128, in run_post_save_methods
self.run_method("on_update")
self = <CustomField: Employee-religious_denomination>
File "apps/frappe/frappe/model/document.py", line 962, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
self = <CustomField: Employee-religious_denomination>
method = 'on_update'
args = ()
kwargs = {}
fn = <function Document.run_method..fn at 0xe32424794900>
File "apps/frappe/frappe/model/document.py", line 1322, in composer
return composed(self, method, args, **kwargs)
self = <CustomField: Employee-religious_denomination>
args = ()
kwargs = {}
hooks = [<function clear_doctype_notifications at 0xe32424f8bb00>, <function process_workflow_actions at 0xe324250177e0>, <function attach_files_to_document at 0xe3242811b560>, <function apply at 0xe3242501e700>, <function update_due_date at 0xe3242501e7a0>, <function apply_permissions_for_non_standard_user_type at 0xe32424e3c0e0>]
method = 'on_update'
doc_events = {'
': {'on_update': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.core.doctype.file.utils.attach_files_to_document', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply', 'frappe.automation.doctype.assignment_rule.assignment_rule.update_due_date', 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'], 'after_rename': ['frappe.desk.notifications.clear_doctype_notifications'], 'on_cancel': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions', 'frappe.automation.doctype.assignment_rule.assignment_rule.apply'], 'on_trash': ['frappe.desk.notifications.clear_doctype_notifications', 'frappe.workflow.doctype.workflow_action.workflow_action.process_workflow_actions'], 'on_update_after_submit': ['frappe.workflow.doctype.workflow_action.workflow_action.process_w...
handler = 'frappe.core.doctype.user_type.user_type.apply_permissions_for_non_standard_user_type'
composed = <function Document.hook..compose..runner at 0xe324247959e0>
compose = <function Document.hook..compose at 0xe32424795620>
f = <function Document.run_method..fn at 0xe32424794900>
File "apps/frappe/frappe/model/document.py", line 1304, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
self = <CustomField: Employee-religious_denomination>
method = 'on_update'
args = ()
kwargs = {}
add_to_return_value = <function Document.hook..add_to_return_value at 0xe32424795440>
fn = <function Document.run_method..fn at 0xe32424794900>
hooks = (<function clear_doctype_notifications at 0xe32424f8bb00>, <function process_workflow_actions at 0xe324250177e0>, <function attach_files_to_document at 0xe3242811b560>, <function apply at 0xe3242501e700>, <function update_due_date at 0xe3242501e7a0>, <function apply_permissions_for_non_standard_user_type at 0xe32424e3c0e0>)
File "apps/frappe/frappe/model/document.py", line 959, in fn
return method_object(*args, **kwargs)
self = <CustomField: Employee-religious_denomination>
args = ()
kwargs = {}
method_object = <bound method CustomField.on_update of <CustomField: Employee-religious_denomination>>
method = 'on_update'
File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 208, in on_update
validate_fields_for_doctype(self.dt)
self = <CustomField: Employee-religious_denomination>
validate_fields_for_doctype = <function validate_fields_for_doctype at 0xe32424cad1c0>
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1201, in validate_fields_for_doctype
validate_fields(meta)
doctype = 'Employee'
meta = <Meta: Employee>
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1649, in validate_fields
check_link_table_options(meta.get("name"), d)
meta = <Meta: Employee>
check_illegal_characters = <function validate_fields..check_illegal_characters at 0xe32424795ee0>
check_invalid_fieldnames = <function validate_fields..check_invalid_fieldnames at 0xe32424795bc0>
check_unique_fieldname = <function validate_fields..check_unique_fieldname at 0xe324247942c0>
check_fieldname_length = <function validate_fields..check_fieldname_length at 0xe32424794720>
check_illegal_mandatory = <function validate_fields..check_illegal_mandatory at 0xe32424794860>
check_link_table_options = <function validate_fields..check_link_table_options at 0xe32424796020>
check_hidden_and_mandatory = <function validate_fields..check_hidden_and_mandatory at 0xe324247949a0>
check_width = <function validate_fields..check_width at 0xe324247947c0>
check_in_list_view = <function validate_fields..check_in_list_view at 0xe32424794a40>
check_in_global_search = <function validate_fields..check_in_global_search at 0xe32424794ae0>
check_dynamic_link_options = <function validate_fields..check_dynamic_link_options at 0xe32424794b80>
check_illegal_default = <function validate_fields..check_illegal_default at 0xe32424794c20>
check_precision = <function validate_fields..check_precision at 0xe32424794cc0>
check_unique_and_text = <function validate_fields..check_unique_and_text at 0xe32424794d60>
check_fold = <function validate_fields..check_fold at 0xe32424794e00>
check_search_fields = <function validate_fields..check_search_fields at 0xe32424794ea0>
check_title_field = <function validate_fields..check_title_field at 0xe32424794f40>
check_image_field = <function validate_fields..check_image_field at 0xe32424794fe0>
check_is_published_field = <function validate_fields..check_is_published_field at 0xe32424795080>
check_website_search_field = <function validate_fields..check_website_search_field at 0xe32424795120>
check_timeline_field = <function validate_fields..check_timeline_field at 0xe324247951c0>
check_sort_field = <function validate_fields..check_sort_field at 0xe32424795260>
check_illegal_depends_on_conditions = <function validate_fields..check_illegal_depends_on_conditions at 0xe32424795300>
check_table_multiselect_option = <function validate_fields..check_table_multiselect_option at 0xe324247953a0>
scrub_options_in_select = <function validate_fields..scrub_options_in_select at 0xe32424795f80>
validate_fetch_from = <function validate_fields..validate_fetch_from at 0xe32424795760>
validate_data_field_type = <function validate_fields..validate_data_field_type at 0xe324247956c0>
check_child_table_option = <function validate_fields..check_child_table_option at 0xe324247958a0>
check_max_height = <function validate_fields..check_max_height at 0xe32424795800>
check_no_of_ratings = <function validate_fields..check_no_of_ratings at 0xe32424795e40>
d = <LinkDocField: religious_denomination parent=Employee>
fieldname_list = ['basic_details_tab', 'basic_information', 'employee', 'naming_series', 'first_name', 'middle_name', 'last_name', 'employee_name', 'column_break_9', 'gender', 'date_of_birth', 'salutation', 'column_break1', 'date_of_joining', 'nationality', 'is_severely_disabled', 'image', 'status', 'erpnext_user', 'user_id', 'create_user', 'create_user_permission', 'company_details_section', 'company', 'department', 'employment_type', 'employee_number', 'column_break_25', 'designation', 'reports_to', 'column_break_18', 'branch', 'grade', 'employment_details', 'job_applicant', 'scheduled_confirmation_date', 'column_break_32', 'final_confirmation_date', 'contract_end_date', 'col_break_22', 'notice_number_of_days', 'date_of_retirement', 'contact_details', 'cell_number', 'column_break_40', 'personal_email', 'company_email', 'column_break4', 'prefered_contact_email', 'prefered_email', 'unsubscribed', 'address_section', 'current_address', 'current_accommodation_type', 'column_break_46', 'permanent_address',...
fields = [,

, <DataDocField: employee parent=Employee>, <SelectDocField: naming_series parent=Employee>, <DataDocField: first_name parent=Employee>, <DataDocField: middle_name parent=Employee>, <DataDocField: last_name parent=Employee>, <DataDocField: employee_name parent=Employee>, , <LinkDocField: gender parent=Employee>, <DateDocField: date_of_birth parent=Employee>, <LinkDocField: salutation parent=Employee>, , <DateDocField: date_of_joining parent=Employee>, <LinkDocField: nationality parent=Employee>, <CheckDocField: is_severely_disabled parent=Employee>, , <SelectDocField: status parent=Employee>,
, <LinkDocField: user_id parent=Employee>, <ButtonDocField: create_user parent=E...
not_allowed_in_list_view = ['Section Break', 'Column Break', 'Tab Break', 'HTML', 'Table', 'Table MultiSelect', 'Button', 'Image', 'Fold', 'Heading', 'Attach Image']
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1276, in check_link_table_options
frappe.throw(
docname = 'Employee'
d = <LinkDocField: religious_denomination parent=Employee>
options = None
File "apps/frappe/frappe/init.py", line 658, in throw
msgprint(
msg = 'Employee: Options must be a valid DocType for field Religious Denomination in row 77'
exc = <class 'frappe.core.doctype.doctype.doctype.WrongOptionsDoctypeLinkError'>
title = None
is_minimizable = False
wide = False
as_list = False
primary_action = None
File "apps/frappe/frappe/init.py", line 623, in msgprint
_raise_exception()
msg = 'Employee: Options must be a valid DocType for field Religious Denomination in row 77'
title = None
raise_exception = <class 'frappe.core.doctype.doctype.doctype.WrongOptionsDoctypeLinkError'>
as_table = False
as_list = False
indicator = 'red'
alert = False
primary_action = None
is_minimizable = False
wide = False
realtime = False
sys = <module 'sys' (built-in)>
_raise_exception = <function msgprint.._raise_exception at 0xe32424795940>
inspect = <module 'inspect' from '/usr/lib/python3.12/inspect.py'>
out = {'message': 'Employee: Options must be a valid DocType for field Religious Denomination in row 77', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': 'f3f48e1e30e65b49b21a39e691dab04cd3bf57c0512e3b957679544d'}
File "apps/frappe/frappe/init.py", line 574, in _raise_exception
raise exc
exc = WrongOptionsDoctypeLinkError('Employee: Options must be a valid DocType for field Religious Denomination in row 77')
inspect = <module 'inspect' from '/usr/lib/python3.12/inspect.py'>
msg = 'Employee: Options must be a valid DocType for field Religious Denomination in row 77'
out = {'message': 'Employee: Options must be a valid DocType for field Religious Denomination in row 77', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': 'f3f48e1e30e65b49b21a39e691dab04cd3bf57c0512e3b957679544d'}
raise_exception = <class 'frappe.core.doctype.doctype.doctype.WrongOptionsDoctypeLinkError'>
frappe.core.doctype.doctype.doctype.WrongOptionsDoctypeLinkError: Employee: Options must be a valid DocType for field Religious Denomination in row 77

@0xD0M1M0
Copy link
Contributor

I saw that error also the other day.

@ThcDelux3
Copy link
Author

After running bench --site erp.rr.business migrate

the Deutschland Dashboard appeared

image

but Konfession is empty...

image

@ThcDelux3
Copy link
Author

I'll try reinstalling the app maybe there is just an issue with the creation of the DB fields...

@ThcDelux3
Copy link
Author

image image

now it looks better...

@barredterra
Copy link
Member

Steps to Reproduce
Install a fresh Frappe instance with ERPNext and HRMS.
Run the following command to install the erpnext_germany app:
bench --site erp.rr.business install-app erpnext_germany

Thanks for the report. However, I can't reproduce this. Can you post more specific/complete instructions?

@0xD0M1M0
Copy link
Contributor

Speaking for me: It happend to me, when I removed ERPNext Germany from an active installation and did a trim tables and trim database and then with a fresh install of it.

@barredterra
Copy link
Member

Speaking for me: It happend to me, when I removed ERPNext Germany from an active installation and did a trim tables and trim database and then with a fresh install of it.

Can't reproduce this either.

@ThcDelux3
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants