Skip to content

Commit

Permalink
fix: check for session user rather than owner
Browse files Browse the repository at this point in the history
  • Loading branch information
rtdany10 committed Nov 23, 2022
1 parent be15419 commit b482e38
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 b482e38

Please sign in to comment.