@@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json | |||||
from .exceptions import * | from .exceptions import * | ||||
from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template | from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template | ||||
__version__ = '9.2.6' | |||||
__version__ = '9.2.7' | |||||
__title__ = "Frappe Framework" | __title__ = "Frappe Framework" | ||||
local = Local() | local = Local() | ||||
@@ -1220,7 +1220,7 @@ def format(*args, **kwargs): | |||||
import frappe.utils.formatters | import frappe.utils.formatters | ||||
return frappe.utils.formatters.format_value(*args, **kwargs) | return frappe.utils.formatters.format_value(*args, **kwargs) | ||||
def get_print(doctype=None, name=None, print_format=None, style=None, html=None, as_pdf=False, doc=None, output = None): | |||||
def get_print(doctype=None, name=None, print_format=None, style=None, html=None, as_pdf=False, doc=None, output = None, no_letterhead = 0): | |||||
"""Get Print Format for given document. | """Get Print Format for given document. | ||||
:param doctype: DocType of document. | :param doctype: DocType of document. | ||||
@@ -1236,6 +1236,7 @@ def get_print(doctype=None, name=None, print_format=None, style=None, html=None, | |||||
local.form_dict.format = print_format | local.form_dict.format = print_format | ||||
local.form_dict.style = style | local.form_dict.style = style | ||||
local.form_dict.doc = doc | local.form_dict.doc = doc | ||||
local.form_dict.no_letterhead = no_letterhead | |||||
if not html: | if not html: | ||||
html = build_page("printview") | html = build_page("printview") | ||||
@@ -41,6 +41,8 @@ def upload(rows = None, submit_after_import=None, ignore_encoding_errors=False, | |||||
update_only = True | update_only = True | ||||
if params.get('from_data_import'): | if params.get('from_data_import'): | ||||
from_data_import = params.get('from_data_import') | from_data_import = params.get('from_data_import') | ||||
if not params.get('skip_errors'): | |||||
skip_errors = params.get('skip_errors') | |||||
frappe.flags.mute_emails = no_email | frappe.flags.mute_emails = no_email | ||||
@@ -237,7 +237,6 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides { | |||||
this.working_state_message = this.get_message( | this.working_state_message = this.get_message( | ||||
__("Setting Up"), | __("Setting Up"), | ||||
__("Sit tight while your system is being setup. This may take a few moments."), | __("Sit tight while your system is being setup. This may take a few moments."), | ||||
'orange', | |||||
true | true | ||||
).appendTo(this.parent); | ).appendTo(this.parent); | ||||
@@ -245,8 +244,7 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides { | |||||
this.current_slide = null; | this.current_slide = null; | ||||
this.completed_state_message = this.get_message( | this.completed_state_message = this.get_message( | ||||
__("Setup Complete"), | __("Setup Complete"), | ||||
__("You're all set!"), | |||||
'green' | |||||
__("You're all set!") | |||||
); | ); | ||||
} | } | ||||
@@ -259,7 +257,7 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides { | |||||
const loading_html = loading | const loading_html = loading | ||||
? '<div style="width:100%;height:100%" class="lds-rolling state-icon"><div></div></div>' | ? '<div style="width:100%;height:100%" class="lds-rolling state-icon"><div></div></div>' | ||||
: `<div style="width:100%;height:100%" class="state-icon"> | : `<div style="width:100%;height:100%" class="state-icon"> | ||||
<i class="fa fa-check-circle text-extra-muted" | |||||
<i class="fa fa-check-circle text-success" | |||||
style="font-size: 64px; margin-top: -8px;"></i> | style="font-size: 64px; margin-top: -8px;"></i> | ||||
</div>`; | </div>`; | ||||
@@ -277,13 +277,6 @@ select.input-sm { | |||||
opacity: 1; | opacity: 1; | ||||
cursor: pointer; | cursor: pointer; | ||||
} | } | ||||
.page-card-container, | |||||
.setup-state { | |||||
background-color: #f5f7fa; | |||||
} | |||||
.page-container .page-card-container { | |||||
background-color: #fff; | |||||
} | |||||
.page-card-container { | .page-card-container { | ||||
padding: 70px; | padding: 70px; | ||||
} | } | ||||
@@ -335,14 +335,6 @@ select.input-sm { | |||||
} | } | ||||
} | } | ||||
.page-card-container, .setup-state { | |||||
background-color: #f5f7fa; | |||||
} | |||||
.page-container .page-card-container { | |||||
background-color: #fff; | |||||
} | |||||
.page-card-container { | .page-card-container { | ||||
padding: 70px; | padding: 70px; | ||||
} | } | ||||
@@ -6,11 +6,12 @@ import frappe | |||||
from frappe.utils import encode, cstr, cint, flt, comma_or | from frappe.utils import encode, cstr, cint, flt, comma_or | ||||
import openpyxl | import openpyxl | ||||
import re | |||||
from openpyxl.styles import Font | from openpyxl.styles import Font | ||||
from openpyxl import load_workbook | from openpyxl import load_workbook | ||||
from six import StringIO, string_types | from six import StringIO, string_types | ||||
ILLEGAL_CHARACTERS_RE = re.compile(r'[\000-\010]|[\013-\014]|[\016-\037]') | |||||
# return xlsx file object | # return xlsx file object | ||||
def make_xlsx(data, sheet_name, wb=None): | def make_xlsx(data, sheet_name, wb=None): | ||||
@@ -30,6 +31,10 @@ def make_xlsx(data, sheet_name, wb=None): | |||||
else: | else: | ||||
value = item | value = item | ||||
if isinstance(item, string_types) and next(ILLEGAL_CHARACTERS_RE.finditer(value), None): | |||||
# Remove illegal characters from the string | |||||
value = re.sub(ILLEGAL_CHARACTERS_RE, '', value) | |||||
clean_row.append(value) | clean_row.append(value) | ||||
ws.append(clean_row) | ws.append(clean_row) | ||||