Facing same issue with PDF missing on mobile browser. Tried desktop view in horizontal as well. No change to view
i got this error while installing version13 on Ubuntu 20.10
Traceback (most recent call last):
File "/home/po/frappe-bench/apps/frappe/frappe/website/render.py", line 49, in render
data = render_page_by_language(path)
File "/home/po/frappe-bench/apps/frappe/frappe/website/render.py", line 178, in render_page_by_language
return render_page(path)
File "/home/po/frappe-bench/apps/frappe/frappe/website/render.py", line 194, in render_page
return build(path)
File "/home/po/frappe-bench/apps/frappe/frappe/website/render.py", line 201, in build
return build_page(path)
File "/home/po/frappe-bench/apps/frappe/frappe/website/render.py", line 224, in build_page
html = frappe.get_template(context.template).render(context)
File "/home/po/frappe-bench/env/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/po/frappe-bench/env/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/po/frappe-bench/env/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/po/frappe-bench/apps/frappe/frappe/./www/login.html", line 62, in top-level template code
<h4>{{ _('Login to {0}').format(app_name or _("Frappe")) }}</h4>
File "/home/po/frappe-bench/apps/frappe/frappe/./templates/web.html", line 1, in top-level template code
{% extends base_template_path %}
File "/home/po/frappe-bench/apps/frappe/frappe/./templates/base.html", line 83, in top-level template code
{% block content %}
File "/home/po/frappe-bench/apps/frappe/frappe/./templates/web.html", line 72, in block "content"
{{ main_content() }}
File "/home/po/frappe-bench/env/lib/python3.8/site-packages/jinja2/sandbox.py", line 462, in call
return __context.call(__obj, *args, **kwargs)
File "/home/po/frappe-bench/env/lib/python3.8/site-packages/jinja2/runtime.py", line 679, in _invoke
rv = self._func(*arguments)
File "/home/po/frappe-bench/apps/frappe/frappe/./templates/web.html", line 15, in template
{% block page_container %}
File "/home/po/frappe-bench/apps/frappe/frappe/./templates/web.html", line 30, in block "page_container"
{%- block page_content -%}{%- endblock -%}
File "/home/po/frappe-bench/apps/frappe/frappe/./www/login.html", line 73, in block "page_content"
{{ _("You need to enable JavaScript for your app to work.") }}<br>{{ _("To enable it follow the instructions in the following link: {0}").format("<a href='https://enable-javascript.com/'>enable-javascript.com</a></p>") }}
File "/home/po/frappe-bench/env/lib/python3.8/site-packages/jinja2/sandbox.py", line 456, in call
return __self.format_string(fmt, args, kwargs, __obj)
File "/home/po/frappe-bench/env/lib/python3.8/site-packages/jinja2/sandbox.py", line 449, in format_string
rv = formatter.vformat(s, args, kwargs)
File "/usr/lib/python3.8/string.py", line 167, in vformat
result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
File "/usr/lib/python3.8/string.py", line 176, in _vformat
for literal_text, field_name, format_spec, conversion in \
ValueError: expected '}' before end of string
any idea how to solve this error??
From my experience, it appears there are still a number of compatibility issues with ERPNext and Python3.8 which comes as default with Ubuntu 20.xx
I simply installed Python3.7 and made sure to specify the Python environment while installing⌠no issues ever since!
Cheers
I am also facing the same issue, when I upgraded from 12-13
I have tried to upgrade from v12 to v13 and end up in the following error. Any clue you can help me with?
File â/home/frappe/frappe-bench/apps/frappe/frappe/model/document.pyâ, line 852, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File â/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.pyâ, line 76, in on_update
validate_fields_for_doctype(self.dt)
File â/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.pyâ, line 739, in validate_fields_for_doctype
validate_fields(meta)
File â/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.pyâ, line 1050, in validate_fields
validate_data_field_type(d)
File â/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.pyâ, line 1004, in validate_data_field_type
frappe.msgprint(text_str + df_options_str, title=âInvalid Data Fieldâ, raise_exception=True)
File â/home/frappe/frappe-bench/apps/frappe/frappe/ init .pyâ, line 406, in msgprint
_raise_exception()
File â/home/frappe/frappe-bench/apps/frappe/frappe/ init .pyâ, line 362, in _raise_exception
raise ValidationError(msg)
> frappe.exceptions.ValidationError: Project Title is an invalid Data field.Only Options allowed for Data field are:
- Name
- Phone
Youâve custom field with type Data and it has invalid options.
Yes, I have a custom field project_title in Quotation, Sales Invoice and Sales Order docs.
The type is VARCHAR
and now I am not able to access the web
Can you help to resolve it please?
Should I worry of loosing data if I change the type? This is a production server.
What is âIssue-legacy_customer_idâ?
f = frappe.get_doc(âCustom Fieldâ, âIssue-legacy_customer_idâ)
Set the options to None, current option Customer is invalid
f.options = None
f.save()
frappe.db.commit()
get into bench console
bench --site <site-name> console
Enter following in console:
for field in frappe.get_all(
"Custom Field",
fields=["*"],
filters={
"fieldtype": "Data",
"options": ["not in", ["Email", "Name", "Phone", "URL"]],
},
):
options = field.get("options")
if options:
name = field.get("name")
fieldtype = field.get("fieldtype")
print(f"field: {name}\nfieldtype: {fieldtype}\nInvalid options: {options}")
f = frappe.get_doc("Custom Field", name)
f.options = None
f.save()
frappe.db.commit()
Here is the out put
field: Sales Order-project_title fieldtype: Data Invalid options: Quotation /home/frappe/frappe-bench/apps/frappe/frappe/www/printview.py:412: DeprecationWarning: invalid escape sequence \( for at_import in list(set(re.findall("(@import url\([^\)]+\)[;]?)", css))): --------------------------------------------------------------------------- OperationalError Traceback (most recent call last) ~/frappe-bench/apps/frappe/frappe/commands/utils.py in <module> 14 f = frappe.get_doc("Custom Field", name) 15 f.options = None ---> 16 f.save() 17 frappe.db.commit() 18 ~/frappe-bench/apps/frappe/frappe/model/document.py in save(self, *args, **kwargs) 282 def save(self, *args, **kwargs): 283 """Wrapper for _save""" --> 284 return self._save(*args, **kwargs) 285 286 def _save(self, ignore_permissions=None, ignore_version=None): ~/frappe-bench/apps/frappe/frappe/model/document.py in _save(self, ignore_permissions, ignore_version) 317 self.validate_higher_perm_levels() 318 self._validate_links() --> 319 self.run_before_save_methods() 320 321 if self._action != "cancel": ~/frappe-bench/apps/frappe/frappe/model/document.py in run_before_save_methods(self) 952 # before_validate method should be executed before ignoring validations 953 if self._action in ("save", "submit"): --> 954 self.run_method("before_validate") 955 956 if self.flags.ignore_validate: ~/frappe-bench/apps/frappe/frappe/model/document.py in run_method(self, method, *args, **kwargs) 859 860 self.run_notifications(method) --> 861 run_webhooks(self, method) 862 run_server_script_for_doc_event(self, method) 863 ~/frappe-bench/apps/frappe/frappe/integrations/doctype/webhook/__init__.py in run_webhooks(doc, method) 23 webhooks_list = frappe.get_all('Webhook', 24 fields=["name", "`condition`", "webhook_docevent", "webhook_doctype"], ---> 25 filters={"enabled": True} 26 ) 27 ~/frappe-bench/apps/frappe/frappe/__init__.py in get_all(doctype, *args, **kwargs) 1431 if not "limit_page_length" in kwargs: 1432 kwargs["limit_page_length"] = 0 -> 1433 return get_list(doctype, *args, **kwargs) 1434 1435 def get_value(*args, **kwargs): ~/frappe-bench/apps/frappe/frappe/__init__.py in get_list(doctype, *args, **kwargs) 1404 """ 1405 import frappe.model.db_query -> 1406 return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs) 1407 1408 def get_all(doctype, *args, **kwargs): ~/frappe-bench/apps/frappe/frappe/model/db_query.py in execute(self, fields, filters, or_filters, docstatus, group_by, order_by, limit_start, limit_page_length, as_list, with_childnames, debug, ignore_permissions, user, with_comment_count, join, distinct, start, page_length, limit, ignore_ifnull, save_user_settings, save_user_settings_fields, update, add_total_row, user_settings, reference_doctype, return_query, strict, pluck, ignore_ddl) 104 if not self.columns: return [] 105 --> 106 result = self.build_and_run() 107 if return_query: 108 return result ~/frappe-bench/apps/frappe/frappe/model/db_query.py in build_and_run(self) 142 else: 143 return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug, --> 144 update=self.update, ignore_ddl=self.ignore_ddl) 145 146 def prepare_args(self): ~/frappe-bench/apps/frappe/frappe/database/database.py in sql(self, query, values, as_dict, as_list, formatted, debug, ignore_ddl, as_utf8, auto_commit, update, explain) 150 151 else: --> 152 self._cursor.execute(query) 153 154 if frappe.flags.in_migrate: ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py in execute(self, query, args) 146 query = self.mogrify(query, args) 147 --> 148 result = self._query(query) 149 self._executed = query 150 return result ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py in _query(self, q) 308 self._last_executed = q 309 self._clear_result() --> 310 conn.query(q) 311 self._do_get_result() 312 return self.rowcount ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py in query(self, sql, unbuffered) 546 sql = sql.encode(self.encoding, "surrogateescape") 547 self._execute_command(COMMAND.COM_QUERY, sql) --> 548 self._affected_rows = self._read_query_result(unbuffered=unbuffered) 549 return self._affected_rows 550 ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py in _read_query_result(self, unbuffered) 773 else: 774 result = MySQLResult(self) --> 775 result.read() 776 self._result = result 777 if result.server_status is not None: ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py in read(self) 1154 def read(self): 1155 try: -> 1156 first_packet = self.connection._read_packet() 1157 1158 if first_packet.is_ok_packet(): ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py in _read_packet(self, packet_type) 723 if self._result is not None and self._result.unbuffered_active is True: 724 self._result.unbuffered_active = False --> 725 packet.raise_for_error() 726 return packet 727 ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/protocol.py in raise_for_error(self) 219 if DEBUG: 220 print("errno =", errno) --> 221 err.raise_mysql_exception(self._data) 222 223 def dump(self): ~/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py in raise_mysql_exception(data) 141 if errorclass is None: 142 errorclass = InternalError if errno < 1000 else OperationalError --> 143 raise errorclass(errno, errval) OperationalError: (1054, "Unknown column 'tabWebhook.enabled' in 'where clause'")
Let me highlight the errors
Hi,
Is the search bar a user permission? If then what is the role permission for this?
Thank you
I faced the same issue and fixed it by altering the field âcustomâ in âtabModule Defâ to be nullable
alter table tabModule Def
modify custom int(1) null;
After Adding Role Employee Self Service User able to see search bar
@revant_one i have an error in bench migrate
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 27, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 309, in migrate
skip_search_index=skip_search_index
File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 73, in migrate
sync_fixtures()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 24, in sync_fixtures
import_doc(frappe.get_app_path(app, "fixtures", fname))
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 191, in import_doc
reset_permissions=True
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 70, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 152, in import_doc
doc.insert()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 267, in insert
self.run_post_save_methods()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 993, in run_post_save_methods
self.run_method("on_update")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 858, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1147, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1130, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 852, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 76, in on_update
validate_fields_for_doctype(self.dt)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 741, in validate_fields_for_doctype
validate_fields(meta)
File "/home/frappe/frappe- bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1052, in validate_fields
validate_data_field_type(d)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 1006, in validate_data_field_type
frappe.msgprint(text_str + df_options_str, title="Invalid Data Field", raise_exception=True)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 411, in msgprint
_raise_exception()
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 367, in _raise_exception
raise ValidationError(msg)
frappe.exceptions.ValidationError: <b>None</b> is an invalid Data field.<br><br>Only
Options allowed for Data field are:<br><ul><li>Email</li><li>Name</li><li>Phone</ul>
i tried below code in console . nothing displayed. but still facing this error
for field in frappe.get_all(
"Custom Field",
fields=["*"],
filters={
"fieldtype": "Data",
"options": ["not in", ["Email", "Name", "Phone", "URL"]],
},
):
options = field.get("options")
if options:
name = field.get("name")
fieldtype = field.get("fieldtype")
print(f"field: {name}\nfieldtype: {fieldtype}\nInvalid options: {options}")
f = frappe.get_doc("Custom Field", name)
f.options = None
f.save()
frappe.db.commit()
backported on 6th June 2021 feat: URL option for Data fieldtype (backport #12898) by mergify[bot] ¡ Pull Request #13138 ¡ frappe/frappe ¡ GitHub
Remove âURLâ from list and try
This error is coming from my custom app. found some data field in a doctype which are not added correctly
Hi,
have you found some workaround ?
pzdr,
Krzysiek