From bc58fd1fa4d2c6f690df299beb8d4e51ec1c48a4 Mon Sep 17 00:00:00 2001 From: Navin-S-R Date: Mon, 8 Dec 2025 15:38:48 +0530 Subject: [PATCH 01/10] fix(asset): prorata daily depr amount calculation --- erpnext/assets/doctype/asset/asset.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 6185eeb9547..3edc41ec077 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -1532,11 +1532,7 @@ def get_straight_line_or_manual_depr_amount(asset, row, schedule_idx, number_of_ # if the Depreciation Schedule is being prepared for the first time else: if row.daily_prorata_based: - amount = ( - flt(asset.gross_purchase_amount) - - flt(asset.opening_accumulated_depreciation) - - flt(row.expected_value_after_useful_life) - ) + amount = flt(asset.gross_purchase_amount) - flt(row.expected_value_after_useful_life) total_days = ( date_diff( get_last_day( @@ -1548,7 +1544,11 @@ def get_straight_line_or_manual_depr_amount(asset, row, schedule_idx, number_of_ ), add_days( get_last_day( - add_months(row.depreciation_start_date, -1 * row.frequency_of_depreciation) + add_months( + row.depreciation_start_date, + (row.frequency_of_depreciation * (asset.number_of_depreciations_booked + 1)) + * -1, + ), ), 1, ), From a299392128d5c5652a66a163ddf6242bc82cbd9a Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Wed, 10 Dec 2025 08:13:22 +0530 Subject: [PATCH 02/10] fix(share balance): use currency field instead of int for rate and amount (cherry picked from commit 2fe5fad884864ed978ef846ce5e27aee3b602b80) # Conflicts: # erpnext/accounts/doctype/share_balance/share_balance.json # erpnext/accounts/doctype/share_balance/share_balance.py --- .../doctype/share_balance/share_balance.json | 41 ++++++++++++++++++- .../doctype/share_balance/share_balance.py | 24 +++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/share_balance/share_balance.json b/erpnext/accounts/doctype/share_balance/share_balance.json index 04d7bb75bf8..dd3e66b1fbf 100644 --- a/erpnext/accounts/doctype/share_balance/share_balance.json +++ b/erpnext/accounts/doctype/share_balance/share_balance.json @@ -74,6 +74,7 @@ "unique": 0 }, { +<<<<<<< HEAD "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, @@ -103,6 +104,15 @@ "set_only_once": 0, "unique": 0 }, +======= + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "read_only": 1, + "reqd": 1 + }, +>>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -193,6 +203,7 @@ "unique": 0 }, { +<<<<<<< HEAD "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, @@ -222,6 +233,15 @@ "set_only_once": 0, "unique": 0 }, +======= + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "read_only": 1, + "reqd": 1 + }, +>>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -313,6 +333,7 @@ "set_only_once": 0, "unique": 0 } +<<<<<<< HEAD ], "has_web_view": 0, "hide_heading": 0, @@ -339,4 +360,22 @@ "sort_order": "DESC", "track_changes": 1, "track_seen": 0 -} \ No newline at end of file +} +======= + ], + "istable": 1, + "links": [], + "modified": "2025-12-10 08:06:40.611761", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Share Balance", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "row_format": "Dynamic", + "sort_field": "creation", + "sort_order": "DESC", + "states": [], + "track_changes": 1 +} +>>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) diff --git a/erpnext/accounts/doctype/share_balance/share_balance.py b/erpnext/accounts/doctype/share_balance/share_balance.py index 4c9ec439eed..4a768caaa23 100644 --- a/erpnext/accounts/doctype/share_balance/share_balance.py +++ b/erpnext/accounts/doctype/share_balance/share_balance.py @@ -6,4 +6,28 @@ from frappe.model.document import Document class ShareBalance(Document): +<<<<<<< HEAD +======= + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + amount: DF.Currency + current_state: DF.Literal["", "Issued", "Purchased"] + from_no: DF.Int + is_company: DF.Check + no_of_shares: DF.Int + parent: DF.Data + parentfield: DF.Data + parenttype: DF.Data + rate: DF.Currency + share_type: DF.Link + to_no: DF.Int + # end: auto-generated types + +>>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) pass From ba9f571886a631e0691366ddb115a6e1706d12c3 Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Wed, 10 Dec 2025 09:52:37 +0530 Subject: [PATCH 03/10] chore: resolve conflict --- .../doctype/share_balance/share_balance.py | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/erpnext/accounts/doctype/share_balance/share_balance.py b/erpnext/accounts/doctype/share_balance/share_balance.py index 4a768caaa23..4c9ec439eed 100644 --- a/erpnext/accounts/doctype/share_balance/share_balance.py +++ b/erpnext/accounts/doctype/share_balance/share_balance.py @@ -6,28 +6,4 @@ from frappe.model.document import Document class ShareBalance(Document): -<<<<<<< HEAD -======= - # begin: auto-generated types - # This code is auto-generated. Do not modify anything in this block. - - from typing import TYPE_CHECKING - - if TYPE_CHECKING: - from frappe.types import DF - - amount: DF.Currency - current_state: DF.Literal["", "Issued", "Purchased"] - from_no: DF.Int - is_company: DF.Check - no_of_shares: DF.Int - parent: DF.Data - parentfield: DF.Data - parenttype: DF.Data - rate: DF.Currency - share_type: DF.Link - to_no: DF.Int - # end: auto-generated types - ->>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) pass From 77b9044d8dfb81e28f6878caf2abf708dbb26fa5 Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Wed, 10 Dec 2025 09:56:15 +0530 Subject: [PATCH 04/10] chore: resolve conflict --- .../doctype/share_balance/share_balance.json | 45 ++----------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/erpnext/accounts/doctype/share_balance/share_balance.json b/erpnext/accounts/doctype/share_balance/share_balance.json index dd3e66b1fbf..4cbe2deffe5 100644 --- a/erpnext/accounts/doctype/share_balance/share_balance.json +++ b/erpnext/accounts/doctype/share_balance/share_balance.json @@ -74,14 +74,13 @@ "unique": 0 }, { -<<<<<<< HEAD "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "fieldname": "rate", - "fieldtype": "Int", + "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -103,16 +102,7 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, -======= - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate", - "read_only": 1, - "reqd": 1 }, ->>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -203,14 +193,13 @@ "unique": 0 }, { -<<<<<<< HEAD "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "fieldname": "amount", - "fieldtype": "Int", + "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -232,16 +221,7 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, -======= - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "read_only": 1, - "reqd": 1 }, ->>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -333,7 +313,6 @@ "set_only_once": 0, "unique": 0 } -<<<<<<< HEAD ], "has_web_view": 0, "hide_heading": 0, @@ -345,7 +324,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2018-01-10 18:32:36.201124", + "modified": "2025-12-10 08:06:40.611761", "modified_by": "Administrator", "module": "Accounts", "name": "Share Balance", @@ -361,21 +340,3 @@ "track_changes": 1, "track_seen": 0 } -======= - ], - "istable": 1, - "links": [], - "modified": "2025-12-10 08:06:40.611761", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Share Balance", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "row_format": "Dynamic", - "sort_field": "creation", - "sort_order": "DESC", - "states": [], - "track_changes": 1 -} ->>>>>>> 2fe5fad884 (fix(share balance): use currency field instead of int for rate and amount) From 8de0d60581e39b86cbc236297ffcc383b5f502a6 Mon Sep 17 00:00:00 2001 From: Navin-S-R Date: Wed, 10 Dec 2025 12:38:27 +0530 Subject: [PATCH 05/10] fix(asset): calculate depreciation amount for non prorata based schedules --- erpnext/assets/doctype/asset/asset.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 3edc41ec077..eb19ff1c43d 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -1571,11 +1571,9 @@ def get_straight_line_or_manual_depr_amount(asset, row, schedule_idx, number_of_ return daily_depr_amount * (date_diff(to_date, from_date) + 1) else: - return ( - flt(asset.gross_purchase_amount) - - flt(asset.opening_accumulated_depreciation) - - flt(row.expected_value_after_useful_life) - ) / flt(row.total_number_of_depreciations - asset.number_of_depreciations_booked) + return (flt(asset.gross_purchase_amount) - flt(row.expected_value_after_useful_life)) / flt( + row.total_number_of_depreciations + ) def get_shift_depr_amount(asset, row, schedule_idx): From 6ea7393f7daa05ae989b91305edd75fc4b6bdabf Mon Sep 17 00:00:00 2001 From: Navin-S-R Date: Wed, 10 Dec 2025 13:35:57 +0530 Subject: [PATCH 06/10] fix: update expected schedules on test case test_schedule_for_straight_line_method_for_existing_asset --- erpnext/assets/doctype/asset/test_asset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py index b89027578c5..7700aed69c4 100644 --- a/erpnext/assets/doctype/asset/test_asset.py +++ b/erpnext/assets/doctype/asset/test_asset.py @@ -660,7 +660,7 @@ class TestDepreciationMethods(AssetSetup): available_for_use_date="2030-06-06", is_existing_asset=1, number_of_depreciations_booked=2, - opening_accumulated_depreciation=47095.89, + opening_accumulated_depreciation=47178.08, expected_value_after_useful_life=10000, depreciation_start_date="2032-12-31", total_number_of_depreciations=3, @@ -668,7 +668,7 @@ class TestDepreciationMethods(AssetSetup): ) self.assertEqual(asset.status, "Draft") - expected_schedules = [["2032-12-31", 42904.11, 90000.0]] + expected_schedules = [["2032-12-31", 30000.0, 77178.08], ["2033-06-06", 12821.92, 90000.0]] schedules = [ [cstr(d.schedule_date), flt(d.depreciation_amount, 2), d.accumulated_depreciation_amount] for d in asset.get("schedules") From a15b0108682f3892aebfbf6d562776a3fa763368 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Thu, 11 Dec 2025 14:59:05 +0530 Subject: [PATCH 07/10] fix(currency exchange settings): added backward compatibility for frankfurter api (cherry picked from commit 5c2bb66028f40ab4177ff17986fc87b5300fefd7) # Conflicts: # erpnext/patches.txt --- .../currency_exchange_settings.js | 2 +- .../currency_exchange_settings.py | 6 ++-- erpnext/patches.txt | 36 +++++++++++++++++++ ...rency_exchange_settings_for_frankfurter.py | 7 +++- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js index c3531420ce1..40f0938ee1c 100644 --- a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js +++ b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.js @@ -19,7 +19,7 @@ frappe.ui.form.on("Currency Exchange Settings", { to: "{to_currency}", }; add_param(frm, r.message, params, result); - } else if (frm.doc.service_provider == "frankfurter.dev") { + } else if (["frankfurter.app", "frankfurter.dev"].includes(frm.doc.service_provider)) { let result = ["rates", "{to_currency}"]; let params = { base: "{from_currency}", diff --git a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py index b36952ab4ff..d10c2947f2d 100644 --- a/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py +++ b/erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.py @@ -35,7 +35,7 @@ class CurrencyExchangeSettings(Document): self.append("req_params", {"key": "date", "value": "{transaction_date}"}) self.append("req_params", {"key": "from", "value": "{from_currency}"}) self.append("req_params", {"key": "to", "value": "{to_currency}"}) - elif self.service_provider == "frankfurter.dev": + elif self.service_provider in ("frankfurter.dev", "frankfurter.app"): self.set("result_key", []) self.set("req_params", []) @@ -80,9 +80,11 @@ class CurrencyExchangeSettings(Document): @frappe.whitelist() def get_api_endpoint(service_provider: str | None = None, use_http: bool = False): - if service_provider and service_provider in ["exchangerate.host", "frankfurter.dev"]: + if service_provider and service_provider in ["exchangerate.host", "frankfurter.dev", "frankfurter.app"]: if service_provider == "exchangerate.host": api = "api.exchangerate.host/convert" + elif service_provider == "frankfurter.app": + api = "api.frankfurter.app/{transaction_date}" elif service_provider == "frankfurter.dev": api = "api.frankfurter.dev/v1/{transaction_date}" diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 484133b7b25..4a08af08f29 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -377,4 +377,40 @@ execute:frappe.db.set_single_value("Accounts Settings", "receivable_payable_fetc erpnext.patches.v14_0.set_update_price_list_based_on erpnext.patches.v14_0.rename_group_by_to_categorize_by_in_custom_reports erpnext.patches.v14_0.update_full_name_in_contract +<<<<<<< HEAD erpnext.patches.v16_0.update_currency_exchange_settings_for_frankfurter +======= +erpnext.patches.v15_0.drop_sle_indexes #2025-09-18 +erpnext.patches.v15_0.update_pick_list_fields +execute:frappe.db.set_single_value("Accounts Settings", "confirm_before_resetting_posting_date", 1) +erpnext.patches.v15_0.rename_pos_closing_entry_fields #2025-06-13 +erpnext.patches.v15_0.update_pegged_currencies +erpnext.patches.v15_0.set_status_cancelled_on_cancelled_pos_opening_entry_and_pos_closing_entry +erpnext.patches.v15_0.set_company_on_pos_inv_merge_log +erpnext.patches.v15_0.update_payment_ledger_entries_against_advance_doctypes +erpnext.patches.v15_0.rename_price_list_to_buying_price_list +erpnext.patches.v15_0.repost_gl_entries_with_no_account_subcontracting #2025-08-04 +erpnext.patches.v15_0.patch_missing_buying_price_list_in_material_request +erpnext.patches.v15_0.remove_sales_partner_from_consolidated_sales_invoice +erpnext.patches.v15_0.update_uae_zero_rated_fetch +erpnext.patches.v15_0.add_company_payment_gateway_account +erpnext.patches.v16_0.set_invoice_type_in_pos_settings +erpnext.patches.v15_0.update_fieldname_in_accounting_dimension_filter +erpnext.patches.v16_0.make_workstation_operating_components #1 +erpnext.patches.v16_0.set_reporting_currency +erpnext.patches.v16_0.set_posting_datetime_for_sabb_and_drop_indexes +erpnext.patches.v16_0.update_serial_no_reference_name +erpnext.patches.v16_0.update_account_categories_for_existing_accounts +erpnext.patches.v16_0.rename_subcontracted_quantity +erpnext.patches.v16_0.add_new_stock_entry_types +erpnext.patches.v15_0.set_asset_status_if_not_already_set +erpnext.patches.v15_0.toggle_legacy_controller_for_period_closing +erpnext.patches.v16_0.update_serial_batch_entries +erpnext.patches.v16_0.set_company_wise_warehouses +erpnext.patches.v16_0.set_valuation_method_on_companies +erpnext.patches.v15_0.migrate_old_item_wise_tax_detail_data_to_table +erpnext.patches.v16_0.migrate_budget_records_to_new_structure +erpnext.patches.v16_0.update_currency_exchange_settings_for_frankfurter #2025-12-11 +erpnext.patches.v16_0.migrate_account_freezing_settings_to_company +erpnext.patches.v16_0.populate_budget_distribution_total +>>>>>>> 5c2bb66028 (fix(currency exchange settings): added backward compatibility for frankfurter api) diff --git a/erpnext/patches/v16_0/update_currency_exchange_settings_for_frankfurter.py b/erpnext/patches/v16_0/update_currency_exchange_settings_for_frankfurter.py index 68157b1a4ad..9d3f78cc09b 100644 --- a/erpnext/patches/v16_0/update_currency_exchange_settings_for_frankfurter.py +++ b/erpnext/patches/v16_0/update_currency_exchange_settings_for_frankfurter.py @@ -2,8 +2,13 @@ import frappe def execute(): + settings_meta = frappe.get_meta("Currency Exchange Settings") settings = frappe.get_doc("Currency Exchange Settings") - if settings.service_provider != "frankfurter.app": + + if ( + "frankfurter.dev" not in settings_meta.get_options("service_provider").split("\n") + or settings.service_provider != "frankfurter.app" + ): return settings.service_provider = "frankfurter.dev" From ef03d90a085805e173689549365322cfb463fddf Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Thu, 11 Dec 2025 15:58:30 +0530 Subject: [PATCH 08/10] chore: resolve conflict --- erpnext/patches.txt | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 4a08af08f29..429f9da99df 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -377,40 +377,4 @@ execute:frappe.db.set_single_value("Accounts Settings", "receivable_payable_fetc erpnext.patches.v14_0.set_update_price_list_based_on erpnext.patches.v14_0.rename_group_by_to_categorize_by_in_custom_reports erpnext.patches.v14_0.update_full_name_in_contract -<<<<<<< HEAD -erpnext.patches.v16_0.update_currency_exchange_settings_for_frankfurter -======= -erpnext.patches.v15_0.drop_sle_indexes #2025-09-18 -erpnext.patches.v15_0.update_pick_list_fields -execute:frappe.db.set_single_value("Accounts Settings", "confirm_before_resetting_posting_date", 1) -erpnext.patches.v15_0.rename_pos_closing_entry_fields #2025-06-13 -erpnext.patches.v15_0.update_pegged_currencies -erpnext.patches.v15_0.set_status_cancelled_on_cancelled_pos_opening_entry_and_pos_closing_entry -erpnext.patches.v15_0.set_company_on_pos_inv_merge_log -erpnext.patches.v15_0.update_payment_ledger_entries_against_advance_doctypes -erpnext.patches.v15_0.rename_price_list_to_buying_price_list -erpnext.patches.v15_0.repost_gl_entries_with_no_account_subcontracting #2025-08-04 -erpnext.patches.v15_0.patch_missing_buying_price_list_in_material_request -erpnext.patches.v15_0.remove_sales_partner_from_consolidated_sales_invoice -erpnext.patches.v15_0.update_uae_zero_rated_fetch -erpnext.patches.v15_0.add_company_payment_gateway_account -erpnext.patches.v16_0.set_invoice_type_in_pos_settings -erpnext.patches.v15_0.update_fieldname_in_accounting_dimension_filter -erpnext.patches.v16_0.make_workstation_operating_components #1 -erpnext.patches.v16_0.set_reporting_currency -erpnext.patches.v16_0.set_posting_datetime_for_sabb_and_drop_indexes -erpnext.patches.v16_0.update_serial_no_reference_name -erpnext.patches.v16_0.update_account_categories_for_existing_accounts -erpnext.patches.v16_0.rename_subcontracted_quantity -erpnext.patches.v16_0.add_new_stock_entry_types -erpnext.patches.v15_0.set_asset_status_if_not_already_set -erpnext.patches.v15_0.toggle_legacy_controller_for_period_closing -erpnext.patches.v16_0.update_serial_batch_entries -erpnext.patches.v16_0.set_company_wise_warehouses -erpnext.patches.v16_0.set_valuation_method_on_companies -erpnext.patches.v15_0.migrate_old_item_wise_tax_detail_data_to_table -erpnext.patches.v16_0.migrate_budget_records_to_new_structure erpnext.patches.v16_0.update_currency_exchange_settings_for_frankfurter #2025-12-11 -erpnext.patches.v16_0.migrate_account_freezing_settings_to_company -erpnext.patches.v16_0.populate_budget_distribution_total ->>>>>>> 5c2bb66028 (fix(currency exchange settings): added backward compatibility for frankfurter api) From 6f6cbb717ef47483cafabdb2957ec7eb168a9b5b Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 14 Dec 2025 12:10:26 +0530 Subject: [PATCH 09/10] fix: Short circuit guest perm checks --- erpnext/support/doctype/issue/issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index 0cb56e6375c..3ecf2fdacca 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -158,7 +158,7 @@ def get_issue_list(doctype, txt, filters, limit_start, limit_page_length=20, ord customer = contact_doc.get_link_for("Customer") ignore_permissions = False - if is_website_user(): + if is_website_user() and user != "Guest": if not filters: filters = {} From 67c0d08569d159b64444ab39f5962ad5e2856918 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 14:31:02 +0530 Subject: [PATCH 10/10] fix(transaction-deletion): Add virtual doctypes to the list of ignored doctypes (backport #51063) (#51086) * fix: Add virtual doctypes to the list of ignored doctypes in transaction deletion (cherry picked from commit c7a7cb2b9016c38791a7dafb179833448488f4c9) * refactor: switch to `or_filters` so the query hits the DB only once (cherry picked from commit 45a7195abea682419d8e2393679f4981d2fdad9e) * refactor: remove redundant assignment of doctypes_to_be_ignored_list (cherry picked from commit 0f7d89f4d113e7fc276c338f6a41d362e43164d4) --------- Co-authored-by: KerollesFathy --- .../transaction_deletion_record.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py index 5919c21fcbf..44a63579a8e 100644 --- a/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py +++ b/erpnext/setup/doctype/transaction_deletion_record/transaction_deletion_record.py @@ -309,8 +309,9 @@ class TransactionDeletionRecord(Document): self.db_set("error_log", None) def get_doctypes_to_be_ignored_list(self): - singles = frappe.get_all("DocType", filters={"issingle": 1}, pluck="name") - doctypes_to_be_ignored_list = singles + doctypes_to_be_ignored_list = frappe.get_all( + "DocType", or_filters=[["issingle", "=", 1], ["is_virtual", "=", 1]], pluck="name" + ) for doctype in self.doctypes_to_be_ignored: doctypes_to_be_ignored_list.append(doctype.doctype_name)