diff --git a/hrms/hr/doctype/expense_claim/expense_claim.py b/hrms/hr/doctype/expense_claim/expense_claim.py index 455410d445..e01bdcd6a8 100644 --- a/hrms/hr/doctype/expense_claim/expense_claim.py +++ b/hrms/hr/doctype/expense_claim/expense_claim.py @@ -89,12 +89,11 @@ def set_status(self, update=False): self.status = status def validate_company_and_department(self): - if self.department: - if self.company != frappe.db.get_value("Department", self.department, "company"): - frappe.throw( - _("Department {0} does not belong to company: {1}").format(self.department, self.company), - exc=MismatchError, - ) + if self.department and self.company != frappe.db.get_value("Department", self.department, "company"): + frappe.throw( + _("Department {0} does not belong to company: {1}").format(self.department, self.company), + exc=MismatchError, + ) def on_update(self): share_doc_with_approver(self, self.expense_approver)