frappe / print_designer

Visual print designer for Frappe / ERPNext
GNU Affero General Public License v3.0
179 stars 101 forks source link

"Options for print_designer_template_app must be set before setting the default value" #255

Open 2old4thisShit opened 1 month ago

2old4thisShit commented 1 month ago

Hello! I have encountered this problem after installing on a new site.

Installing xestion... Updating DocTypes for xestion: [========================================] 100% An error occurred while installing xestion: Options for print_designer_template_app must be set before setting the default value. Traceback with variables (most recent call last): File "apps/frappe/frappe/commands/site.py", line 445, in install_app _install_app(app, verbose=context.verbose, force=force) context = {'sites': ['xestion.com'], 'force': False, 'verbose': False, 'profile': False} apps = ('xestion',) force = False _install_app = <function install_app at 0x7f8d37ca3010> filelock = <function filelock at 0x7f8d37ca2cb0> exit_code = 0 site = 'xestion.com' app = 'xestion' err = ValidationError('Options for print_designer_template_app must be set before setting the default value.') File "apps/frappe/frappe/installer.py", line 317, in install_app sync_fixtures(name) name = 'xestion' verbose = False set_as_patched = True force = False sync_jobs = <function sync_jobs at 0x7f8d3688f010> sync_for = <function sync_for at 0x7f8d3688fa30> sync_customizations = <function sync_customizations at 0x7f8d37c45630> sync_fixtures = <function sync_fixtures at 0x7f8d3688fc70> app_hooks = {'app_description': ['App de xestion'], 'app_email': ['info@xestion.com'], 'app_license': ['MIT'], 'app_logo_url': ['/assets/xestion/images/logofuner.png'], 'app_name': ['xestion'], 'app_publisher': ['xestion'], 'app_title': ['xestion'], 'fixtures': [{'doctype': 'Print Format', 'filters': [['module', 'in', 'xestion']]}, {'doctype': 'Property Setter', 'filters': [['module', 'in', 'xestion']]}, 'Server Script', 'Custom Field', 'XF Plantilla Documentacion', 'XF Profesional', 'XF Centro', 'XF Tipo profesional', 'XF Empresa', 'XF Tipo expediente', 'XF Municipio', 'XF Tipo acto', 'Item', 'Item Group', 'XF Tipo documentacion', 'Customer', 'Supplier', 'Workspace', 'Role', 'Custom DocPerm'], 'website_context': {'favicon': ['/assets/xestion/images/funer.ico'], 'splash_image': ['/assets/xestion/images/logofuner.png'], 'footer_logo': ['/assets/xestion/images/log... installed_apps = ['frappe', 'erpnext', 'print_designer'] fn = 'print_designer.install.after_app_install' File "apps/frappe/frappe/utils/fixtures.py", line 22, in sync_fixtures import_fixtures(app) app = 'xestion' apps = ['xestion'] File "apps/frappe/frappe/utils/fixtures.py", line 41, in import_fixtures import_doc(file_path) app = 'xestion' fixtures_path = 'apps/xestion/xestion/fixtures' fixture_files = ['xf_tipo_documentacion.json', 'print_format.json', 'xf_tipo_profesional.json', 'xf_plantilla_documentacion.json', 'custom_docperm.json', 'xf_tipo_acto.json', 'supplier.json', 'server_script.json', 'xf_profesional.json', 'xf_empresa.json', 'customer.json', 'xf_centro.json', 'custom_field.json', 'property_setter.json', 'item_group.json', 'xf_tipo_expediente.json', 'item.json', 'role.json', 'xf_municipio.json', 'workspace.json'] fname = 'custom_field.json' file_path = 'apps/xestion/xestion/fixtures/custom_field.json' File "apps/frappe/frappe/core/doctype/data_import/data_import.py", line 265, in import_doc import_file_by_path( pre_process = None files = ['apps/xestion/xestion/fixtures/custom_field.json'] f = 'apps/xestion/xestion/fixtures/custom_field.json' path = 'apps/xestion/xestion/fixtures/custom_field.json' File "apps/frappe/frappe/modules/import_file.py", line 146, in import_file_by_path import_doc( path = 'apps/xestion/xestion/fixtures/custom_field.json' force = True data_import = True pre_process = None ignore_version = None reset_permissions = True docs = [{'allow_in_quick_entry': 0, 'allow_on_submit': 0, 'bold': 0, 'collapsible': 0, 'collapsible_depends_on': None, 'columns': 0, 'default': '0', 'depends_on': None, 'description': None, 'docstatus': 0, 'doctype': 'Custom Field', 'dt': 'Web Form', 'fetch_from': None, 'fetch_if_empty': 0, 'fieldname': 'accept_payment', 'fieldtype': 'Check', 'hidden': 0, 'hide_border': 0, 'hide_days': 0, 'hide_seconds': 0, 'ignore_user_permissions': 0, 'ignore_xss_filter': 0, 'in_global_search': 0, 'in_list_view': 0, 'in_preview': 0, 'in_standard_filter': 0, 'insert_after': 'payments', 'is_system_generated': 1, 'is_virtual': 0, 'label': 'Accept Payment', 'length': 0, 'mandatory_depends_on': None, 'modified': '2023-10-27 08:35:48.554776', 'module': None, 'name': 'Web Form-accept_payment', 'no_copy': 0, 'non_negative': 0, 'options': None, 'permlevel': 0, 'precision': '', 'print_hide': 0, 'print_hide_if_no_value': 0, 'print_width': None, 'read_only': 0, 'read_only_depends_on': None, 'report_hide': 0, 'reqd': 0,... calculated_hash = '76de739a0dda4c174bf74693d2665d03' doc = {'allow_in_quick_entry': 0, 'allow_on_submit': 0, 'bold': 0, 'collapsible': 0, 'collapsible_depends_on': None, 'columns': 0, 'default': '0', 'depends_on': None, 'description': None, 'docstatus': 0, 'doctype': 'Custom Field', 'dt': 'Print Format', 'fetch_from': None, 'fetch_if_empty': 0, 'fieldname': 'print_designer', 'fieldtype': 'Check', 'hidden': 1, 'hide_border': 0, 'hide_days': 0, 'hide_seconds': 0, 'ignore_user_permissions': 0, 'ignore_xss_filter': 0, 'in_global_search': 0, 'in_list_view': 0, 'in_preview': 0, 'in_standard_filter': 0, 'insert_after': None, 'is_system_generated': 1, 'is_virtual': 0, 'label': 'Print Designer', 'length': 0, 'mandatory_depends_on': None, 'modified': '2023-10-10 09:37:23.074138', 'module': None, 'name': 'Print Format-print_designer', 'no_copy': 0, 'non_negative': 0, 'options': None, 'permlevel': 0, 'precision': '', 'print_hide': 0, 'print_hide_if_no_value': 0, 'print_width': None, 'read_only': 0, 'read_only_depends_on': None, 'report_hide': 0, 'reqd': 0... db_modified_timestamp = datetime.datetime(2024, 5, 8, 16, 0, 18, 191655) is_db_timestamp_latest = True new_modified_timestamp = '2023-10-27 08:35:48.554776' File "apps/frappe/frappe/modules/import_file.py", line 239, in import_doc doc.insert() docdict = {'allow_in_quick_entry': 0, 'allow_on_submit': 0, 'bold': 0, 'collapsible': 0, 'collapsible_depends_on': None, 'columns': 0, 'default': '0', 'depends_on': None, 'description': None, 'docstatus': 0, 'doctype': 'Custom Field', 'dt': 'Print Format', 'fetch_from': None, 'fetch_if_empty': 0, 'fieldname': 'print_designer', 'fieldtype': 'Check', 'hidden': 1, 'hide_border': 0, 'hide_days': 0, 'hide_seconds': 0, 'ignore_user_permissions': 0, 'ignore_xss_filter': 0, 'in_global_search': 0, 'in_list_view': 0, 'in_preview': 0, 'in_standard_filter': 0, 'insert_after': None, 'is_system_generated': 1, 'is_virtual': 0, 'label': 'Print Designer', 'length': 0, 'mandatory_depends_on': None, 'modified': '2023-10-10 09:37:23.074138', 'module': None, 'name': 'Print Format-print_designer', 'no_copy': 0, 'non_negative': 0, 'options': None, 'permlevel': 0, 'precision': '', 'print_hide': 0, 'print_hide_if_no_value': 0, 'print_width': None, 'read_only': 0, 'read_only_depends_on': None, 'report_hide': 0, 'reqd': 0... data_import = True pre_process = None ignore_version = None reset_permissions = True path = 'apps/xestion/xestion/fixtures/custom_field.json' controller = <class 'frappe.custom.doctype.custom_field.custom_field.CustomField'> doc = File "apps/frappe/frappe/model/document.py", line 315, in insert self.run_post_save_methods() self = 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 = File "apps/frappe/frappe/model/document.py", line 962, in run_method out = Document.hook(fn)(self, *args, kwargs) self = args = () kwargs = {} fn = <function Document.run_method..fn at 0x7f8d2713beb0> method = 'on_update' File "apps/frappe/frappe/model/document.py", line 1322, in composer return composed(self, method, *args, kwargs) self = args = () kwargs = {} hooks = [<function clear_doctype_notifications at 0x7f8d29a7f7f0>, <function process_workflow_actions at 0x7f8d29a92e60>, <function attach_files_to_document at 0x7f8d36836d40>, <function apply at 0x7f8d29aa97e0>, <function update_due_date at 0x7f8d29aa9870>, <function apply_permissions_for_non_standard_user_type at 0x7f8d29aab130>] 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 0x7f8d2713a8c0> compose = <function Document.hook..compose at 0x7f8d2713bd00> f = <function Document.run_method..fn at 0x7f8d2713beb0> File "apps/frappe/frappe/model/document.py", line 1304, in runner add_to_return_value(self, fn(self, args, kwargs)) self = method = 'on_update' args = () kwargs = {} add_to_return_value = <function Document.hook..add_to_return_value at 0x7f8d2713bd90> fn = <function Document.run_method..fn at 0x7f8d2713beb0> hooks = (<function clear_doctype_notifications at 0x7f8d29a7f7f0>, <function process_workflow_actions at 0x7f8d29a92e60>, <function attach_files_to_document at 0x7f8d36836d40>, <function apply at 0x7f8d29aa97e0>, <function update_due_date at 0x7f8d29aa9870>, <function apply_permissions_for_non_standard_user_type at 0x7f8d29aab130>) File "apps/frappe/frappe/model/document.py", line 959, in fn return method_object(*args, kwargs) self = args = () kwargs = {} method_object = <bound method CustomField.on_update of > method = 'on_update' File "apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 207, in on_update validate_fields_for_doctype(self.dt) self = validate_fields_for_doctype = <function validate_fields_for_doctype at 0x7f8d2994f0a0> File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1201, in validate_fields_for_doctype validate_fields(meta) doctype = 'Print Format' meta = File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1643, in validate_fields check_illegal_default(d) check_illegal_characters = <function validate_fields..check_illegal_characters at 0x7f8d26e895a0> check_invalid_fieldnames = <function validate_fields..check_invalid_fieldnames at 0x7f8d26e89360> check_unique_fieldname = <function validate_fields..check_unique_fieldname at 0x7f8d26e89750> check_fieldname_length = <function validate_fields..check_fieldname_length at 0x7f8d26e892d0> check_illegal_mandatory = <function validate_fields..check_illegal_mandatory at 0x7f8d26e89870> check_link_table_options = <function validate_fields..check_link_table_options at 0x7f8d26e897e0> check_hidden_and_mandatory = <function validate_fields..check_hidden_and_mandatory at 0x7f8d26e89240> check_width = <function validate_fields..check_width at 0x7f8d26e89630> check_in_list_view = <function validate_fields..check_in_list_view at 0x7f8d26e89480> check_in_global_search = <function validate_fields..check_in_global_search at 0x7f8d26e891b0> check_dynamic_link_options = <function validate_fields..check_dynamic_link_options at 0x7f8d26e893f0> check_illegal_default = <function validate_fields..check_illegal_default at 0x7f8d26e89510> check_precision = <function validate_fields..check_precision at 0x7f8d26e896c0> check_unique_and_text = <function validate_fields..check_unique_and_text at 0x7f8d26e89120> check_fold = <function validate_fields..check_fold at 0x7f8d26e89090> check_search_fields = <function validate_fields..check_search_fields at 0x7f8d26e89000> check_title_field = <function validate_fields..check_title_field at 0x7f8d26e88f70> check_image_field = <function validate_fields..check_image_field at 0x7f8d26e88ee0> check_is_published_field = <function validate_fields..check_is_published_field at 0x7f8d26e88e50> check_website_search_field = <function validate_fields..check_website_search_field at 0x7f8d26e88dc0> check_timeline_field = <function validate_fields..check_timeline_field at 0x7f8d26e88d30> check_sort_field = <function validate_fields..check_sort_field at 0x7f8d26e88ca0> check_illegal_depends_on_conditions = <function validate_fields..check_illegal_depends_on_conditions at 0x7f8d26e88c10> check_table_multiselect_option = <function validate_fields..check_table_multiselect_option at 0x7f8d26e88a60> scrub_options_in_select = <function validate_fields..scrub_options_in_select at 0x7f8d26e889d0> scrub_fetch_from = <function validate_fields..scrub_fetch_from at 0x7f8d26e88940> validate_data_field_type = <function validate_fields..validate_data_field_type at 0x7f8d26e88af0> check_child_table_option = <function validate_fields..check_child_table_option at 0x7f8d26e88b80> check_max_height = <function validate_fields..check_max_height at 0x7f8d26e89990> check_no_of_ratings = <function validate_fields..check_no_of_ratings at 0x7f8d26e89900> d = fieldname_list = ['print_designer_print_format', 'print_designer_preview_img', 'print_designer_after_table', 'print_designer_settings', 'print_designer_header', 'print_designer_footer', 'print_designer_body', 'print_designer', 'doc_type', 'module', 'default_print_language', 'column_break_3', 'standard', 'print_designer_template_app', 'custom_format', 'disabled', 'section_break_6', 'print_format_type', 'raw_printing', 'html', 'raw_commands', 'section_break_9', 'margin_top', 'margin_bottom', 'margin_left', 'margin_right', 'align_labels_right', 'show_section_headings', 'line_breaks', 'absolute_value', 'column_break_11', 'font_size', 'font', 'page_number', 'css_section', 'css', 'custom_html_help', 'section_break_13', 'print_format_help', 'format_data', 'print_format_builder', 'print_format_builder_beta'] fields = [, , , , , , , , , , , , , , , ,

, <SelectDocField: print_... meta = 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 1344, in check_illegal_default frappe.throw( d = File "apps/frappe/frappe/init.py", line 645, in throw msgprint( msg = 'Options for print_designer_template_app must be set before setting the default value.' exc = <class 'frappe.exceptions.ValidationError'> title = None is_minimizable = False wide = False as_list = False primary_action = None File "apps/frappe/frappe/init.py", line 610, in msgprint _raise_exception() title = None 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 0x7f8d26e89a20> inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'> msg = 'Options for print_designer_template_app must be set before setting the default value.' out = {'message': 'Options for print_designer_template_app must be set before setting the default value.', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': '7ff09e5ae58b5f4357f6d881c3fcb18a7b6e575157a07d75f333ab73'} raise_exception = <class 'frappe.exceptions.ValidationError'> File "apps/frappe/frappe/init.py", line 561, in _raise_exception raise exc exc = ValidationError('Options for print_designer_template_app must be set before setting the default value.') inspect = <module 'inspect' from '/usr/lib/python3.10/inspect.py'> msg = 'Options for print_designer_template_app must be set before setting the default value.' out = {'message': 'Options for print_designer_template_app must be set before setting the default value.', 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': '7ff09e5ae58b5f4357f6d881c3fcb18a7b6e575157a07d75f333ab73'} raise_exception = <class 'frappe.exceptions.ValidationError'> frappe.exceptions.ValidationError: Options for print_designer_template_app must be set before setting the default value.

The problem appeared when installing a custom app with exported print formats in the fixtures, although everything seems to be working correctly.

Bench version: erpnext 15.22.2 (main) frappe 15.26.0 (main) print_designer 1.2.0 (main) xestion 0.2.0