From 88ce356d62d8175ec0b6e65a64e08b2b89ea33f9 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Sat, 20 Jun 2026 19:25:58 +0530 Subject: [PATCH 1/3] fix(err): add missing permission check on `get_account_details` (cherry picked from commit 9bf1e847d2cf97d2700e5a1e9b1c339c083fd712) --- .../exchange_rate_revaluation/exchange_rate_revaluation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index 0c21bbb2e0b..f17d34eac47 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -616,6 +616,10 @@ def calculate_exchange_rate_using_last_gle(company, account, party_type, party): def get_account_details( company, posting_date, account, party_type=None, party=None, rounding_loss_allowance: float | None = None ): + if not account: + return + frappe.has_permission("Account", doc=account, throw=True) + if not (company and posting_date): frappe.throw(_("Company and Posting Date is mandatory")) From bf58393fda3337ee8d1cf7683f88845a0f635a40 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Sat, 20 Jun 2026 19:28:20 +0530 Subject: [PATCH 2/3] fix(report_utils): remove unnecessary whitelist decorator on `get_invoiced_item_gross_margin` (cherry picked from commit e29535f29c50db187138585d11d5fabf3428598c) # Conflicts: # erpnext/accounts/report/utils.py --- erpnext/accounts/report/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index bf604a36db0..64943db96ba 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -146,8 +146,17 @@ def get_appropriate_company(filters): return company +<<<<<<< HEAD @frappe.whitelist() def get_invoiced_item_gross_margin(sales_invoice=None, item_code=None, company=None, with_item_data=False): +======= +def get_invoiced_item_gross_margin( + sales_invoice: str | None = None, + item_code: str | None = None, + company: str | None = None, + with_item_data: bool = False, +): +>>>>>>> e29535f29c (fix(report_utils): remove unnecessary whitelist decorator on `get_invoiced_item_gross_margin`) from erpnext.accounts.report.gross_profit.gross_profit import GrossProfitGenerator sales_invoice = sales_invoice or frappe.form_dict.get("sales_invoice") From e605675e11da11ca7274b01a6dd627854da64c7d Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Sat, 20 Jun 2026 20:06:09 +0530 Subject: [PATCH 3/3] chore: resolve conflicts --- erpnext/accounts/report/utils.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 64943db96ba..8d1730ab294 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -146,17 +146,7 @@ def get_appropriate_company(filters): return company -<<<<<<< HEAD -@frappe.whitelist() def get_invoiced_item_gross_margin(sales_invoice=None, item_code=None, company=None, with_item_data=False): -======= -def get_invoiced_item_gross_margin( - sales_invoice: str | None = None, - item_code: str | None = None, - company: str | None = None, - with_item_data: bool = False, -): ->>>>>>> e29535f29c (fix(report_utils): remove unnecessary whitelist decorator on `get_invoiced_item_gross_margin`) from erpnext.accounts.report.gross_profit.gross_profit import GrossProfitGenerator sales_invoice = sales_invoice or frappe.form_dict.get("sales_invoice")