Merge pull request #24768 from ankush/salary_slip_error
chore: improve error message for missing fields.
This commit is contained in:
commit
916b75a3a3
@ -506,7 +506,8 @@ class SalarySlip(TransactionBase):
|
||||
return amount
|
||||
|
||||
except NameError as err:
|
||||
frappe.throw(_("Name error: {0}").format(err))
|
||||
frappe.throw(_("{0} <br> This error can be due to missing or deleted field.").format(err),
|
||||
title=_("Name error"))
|
||||
except SyntaxError as err:
|
||||
frappe.throw(_("Syntax error in formula or condition: {0}").format(err))
|
||||
except Exception as e:
|
||||
@ -930,7 +931,8 @@ class SalarySlip(TransactionBase):
|
||||
if condition:
|
||||
return frappe.safe_eval(condition, self.whitelisted_globals, data)
|
||||
except NameError as err:
|
||||
frappe.throw(_("Name error: {0}").format(err))
|
||||
frappe.throw(_("{0} <br> This error can be due to missing or deleted field.").format(err),
|
||||
title=_("Name error"))
|
||||
except SyntaxError as err:
|
||||
frappe.throw(_("Syntax error in condition: {0}").format(err))
|
||||
except Exception as e:
|
||||
@ -1242,4 +1244,4 @@ def unlink_ref_doc_from_salary_slip(ref_no):
|
||||
|
||||
def generate_password_for_pdf(policy_template, employee):
|
||||
employee = frappe.get_doc("Employee", employee)
|
||||
return policy_template.format(**employee.as_dict())
|
||||
return policy_template.format(**employee.as_dict())
|
||||
|
Loading…
Reference in New Issue
Block a user