diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.js b/erpnext/accounts/doctype/accounts_settings/accounts_settings.js index 931e05a716b..2fda643640b 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.js +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.js @@ -2,7 +2,15 @@ // For license information, please see license.txt frappe.ui.form.on("Accounts Settings", { - refresh: function (frm) {}, + refresh: function (frm) { + frm.set_query("document_type", "repost_allowed_types", function (doc, cdt, cdn) { + return { + filters: { + name: ["in", frappe.boot.sysdefaults.repost_allowed_doctypes], + }, + }; + }); + }, enable_immutable_ledger: function (frm) { if (!frm.doc.enable_immutable_ledger) { return; diff --git a/erpnext/hooks.py b/erpnext/hooks.py index cc4a08d8b67..2fd4be3a510 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -692,3 +692,10 @@ fields_for_group_similar_items = ["qty", "amount"] # ------------ # List of apps whose translatable strings should be excluded from this app's translations. ignore_translatable_strings_from = ["frappe"] +repost_allowed_doctypes = [ + "Sales Invoice", + "Purchase Invoice", + "Journal Entry", + "Payment Entry", + "Purchase Receipt", +] diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index b2e66ed6114..08cf9154c2b 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -66,6 +66,7 @@ def boot_session(bootinfo): bootinfo.sysdefaults.default_ageing_range = frappe.db.get_single_value( "Accounts Settings", "default_ageing_range" ) + bootinfo.sysdefaults.repost_allowed_doctypes = frappe.get_hooks("repost_allowed_doctypes") def update_page_info(bootinfo):