Skip to content

Commit

Permalink
fix: check if approver is set before sharing doc (backport #590) (#605)
Browse files Browse the repository at this point in the history
Co-authored-by: MOHAMMED NIYAS <[email protected]>
  • Loading branch information
mergify[bot] and niyazrazak authored Jun 16, 2023
1 parent 4066445 commit 1902872
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hrms/hr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,9 @@ def get_previous_claimed_amount(employee, payroll_period, non_pro_rata=False, co


def share_doc_with_approver(doc, user):
if not user:
return

# if approver does not have permissions, share
if not frappe.has_permission(doc=doc, ptype="submit", user=user):
frappe.share.add_docshare(
Expand Down

0 comments on commit 1902872

Please sign in to comment.