Skip to content

Commit

Permalink
fix: auto reorder matreial request mail issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Sep 5, 2024
1 parent f3b91d4 commit fd1979f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erpnext/stock/reorder_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,14 @@ def get_email_list(company):


def get_comapny_wise_users(company):
companies = [company]

if parent_company := frappe.db.get_value("Company", company, "parent_company"):
companies.append(parent_company)

users = frappe.get_all(
"User Permission",
filters={"allow": "Company", "for_value": company, "apply_to_all_doctypes": 1},
filters={"allow": "Company", "for_value": ("in", companies), "apply_to_all_doctypes": 1},
fields=["user"],
)

Expand Down

0 comments on commit fd1979f

Please sign in to comment.