mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 11:09:17 +00:00
refactor: limit reposting to only supported doctypes
(cherry picked from commit 940d3cfe0a)
This commit is contained in:
@@ -2,7 +2,15 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on("Accounts Settings", {
|
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) {
|
enable_immutable_ledger: function (frm) {
|
||||||
if (!frm.doc.enable_immutable_ledger) {
|
if (!frm.doc.enable_immutable_ledger) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -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.
|
# List of apps whose translatable strings should be excluded from this app's translations.
|
||||||
ignore_translatable_strings_from = ["frappe"]
|
ignore_translatable_strings_from = ["frappe"]
|
||||||
|
repost_allowed_doctypes = [
|
||||||
|
"Sales Invoice",
|
||||||
|
"Purchase Invoice",
|
||||||
|
"Journal Entry",
|
||||||
|
"Payment Entry",
|
||||||
|
"Purchase Receipt",
|
||||||
|
]
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ def boot_session(bootinfo):
|
|||||||
bootinfo.sysdefaults.default_ageing_range = frappe.db.get_single_value(
|
bootinfo.sysdefaults.default_ageing_range = frappe.db.get_single_value(
|
||||||
"Accounts Settings", "default_ageing_range"
|
"Accounts Settings", "default_ageing_range"
|
||||||
)
|
)
|
||||||
|
bootinfo.sysdefaults.repost_allowed_doctypes = frappe.get_hooks("repost_allowed_doctypes")
|
||||||
|
|
||||||
|
|
||||||
def update_page_info(bootinfo):
|
def update_page_info(bootinfo):
|
||||||
|
|||||||
Reference in New Issue
Block a user