Skip to content

Commit

Permalink
fix: check for session user rather than owner
Browse files Browse the repository at this point in the history
(cherry picked from commit b482e38)
  • Loading branch information
rtdany10 authored and mergify[bot] committed May 1, 2023
1 parent 6992e72 commit 7d6e2f9
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ def validate_accounts_freeze(self):
)
if not acc_settings.acc_frozen_upto:
return
if acc_settings.frozen_accounts_modifier and self.owner in get_users_with_role(
acc_settings.frozen_accounts_modifier
):
return
if getdate(self.posting_date) <= getdate(acc_settings.acc_frozen_upto):
if acc_settings.frozen_accounts_modifier and frappe.session.user in get_users_with_role(
acc_settings.frozen_accounts_modifier
):
frappe.msgprint(_("Caution: This might alter frozen accounts."))
return
frappe.throw(
_("You cannot repost item valuation before {}").format(acc_settings.acc_frozen_upto)
)
Expand Down

0 comments on commit 7d6e2f9

Please sign in to comment.