Skip to content

Commit

Permalink
fix: auto reorder material request mail issue (backport #43066) (#43068)
Browse files Browse the repository at this point in the history
fix: auto reorder material request mail issue (#43066)

fix: auto reorder matreial request mail issue
(cherry picked from commit a8055a6)

Co-authored-by: rohitwaghchaure <[email protected]>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Sep 5, 2024
1 parent 56dad7d commit d2b2002
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 d2b2002

Please sign in to comment.