fix: auto reorder material request mail issue (backport #43066) (#43068)

fix: auto reorder material request mail issue (#43066)

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

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-09-05 16:00:47 +05:30
committed by GitHub
parent 56dad7d365
commit d2b2002664

View File

@@ -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"],
)