fix: lint

This commit is contained in:
casesolved-co-uk 2021-04-18 22:13:39 +00:00
parent 6998786055
commit d5256b60d4
2 changed files with 5 additions and 5 deletions

View File

@ -273,7 +273,7 @@ erpnext.TaxDetail = class TaxDetail {
click: () => {
let cur_section = this.controls['section_name'].get_input_value();
if (cur_section) {
frappe.confirm(__('Are you sure you want to delete section ') + cur_section + '?',
frappe.confirm(__('Are you sure you want to delete section') + ' ' + cur_section + '?',
() => {this.delete(cur_section, 'section')});
}
}
@ -354,7 +354,7 @@ erpnext.TaxDetail = class TaxDetail {
click: () => {
const component = this.controls['component'].get_input_value();
if (component) {
frappe.confirm(__('Are you sure you want to delete component ') + component + '?',
frappe.confirm(__('Are you sure you want to delete component') + ' ' + component + '?',
() => {this.delete(component, 'component')});
}
}

View File

@ -80,12 +80,12 @@ def run_report(report_name, data):
report[section_name]['subtotal'] += row['amount']
if component['type'] == 'section':
if component_name == section_name:
frappe.throw(_("A report component cannot refer to its parent section: ") + section_name)
frappe.throw(_("A report component cannot refer to its parent section") + ": " + section_name)
try:
report[section_name]['rows'] += report[component_name]['rows']
report[section_name]['subtotal'] += report[component_name]['subtotal']
except KeyError:
frappe.throw(_("A report component can only refer to an earlier section: ") + section_name)
frappe.throw(_("A report component can only refer to an earlier section") + ": " + section_name)
if show_detail:
new_data += report[section_name]['rows']
@ -141,7 +141,7 @@ def filter_match(value, string):
try:
num = float(string) if string.strip() else 0
return eval(f'{value} {operator} {num}')
return frappe.safe_eval(f'{value} {operator} {num}')
except ValueError:
if operator == '<':
return True