feat: add ability to disable new product suggestion

This commit is contained in:
git-avc 2025-11-23 13:38:09 +01:00
parent 091e12324e
commit fd6be0549d
4 changed files with 35 additions and 13 deletions

View file

@ -96,6 +96,7 @@
"disable_system_update_notification",
"disable_change_log_notification",
"hide_empty_read_only_fields",
"disable_product_suggestion",
"backups_tab",
"sec_backup_limit",
"backup_limit",
@ -770,12 +771,18 @@
{
"fieldname": "column_break_bzfr",
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "disable_product_suggestion",
"fieldtype": "Check",
"label": "Disable Product Suggestion"
}
],
"icon": "fa fa-cog",
"issingle": 1,
"links": [],
"modified": "2025-11-04 16:47:54.230874",
"modified": "2025-11-23 13:17:57.577690",
"modified_by": "Administrator",
"module": "Core",
"name": "System Settings",

View file

@ -43,6 +43,7 @@ class SystemSettings(Document):
deny_multiple_sessions: DF.Check
disable_change_log_notification: DF.Check
disable_document_sharing: DF.Check
disable_product_suggestion: DF.Check
disable_standard_email_footer: DF.Check
disable_system_update_notification: DF.Check
disable_user_pass_login: DF.Check

View file

@ -198,18 +198,20 @@ frappe.ui.form.PrintView = class {
this.setup_customize_dialog();
// print designer link
if (Object.keys(frappe.boot.versions).includes("print_designer")) {
this.page.add_inner_message(`
<a style="line-height: 2.4" href="/app/print-designer?doctype=${this.frm.doctype}">
${__("Try the new Print Designer")}
</a>
`);
} else {
this.page.add_inner_message(`
<a style="line-height: 2.4" href="https://frappecloud.com/marketplace/apps/print_designer?utm_source=framework-desk&utm_medium=print-view&utm_campaign=try-link">
${__("Try the new Print Designer")}
</a>
`);
if (frappe.boot.sysdefaults.disable_product_suggestion !== "1") {
if (Object.keys(frappe.boot.versions).includes("print_designer")) {
this.page.add_inner_message(`
<a style="line-height: 2.4" href="/app/print-designer?doctype=${this.frm.doctype}">
${__("Try the new Print Designer")}
</a>
`);
} else {
this.page.add_inner_message(`
<a style="line-height: 2.4" href="https://frappecloud.com/marketplace/apps/print_designer?utm_source=framework-desk&utm_medium=print-view&utm_campaign=try-link">
${__("Try the new Print Designer")}
</a>
`);
}
}
let tasks = [
this.set_default_print_format,

View file

@ -294,6 +294,10 @@ frappe.views.ListSidebar = class ListSidebar {
}
add_insights_banner() {
if (frappe.boot.sysdefaults.disable_product_suggestion == "1") {
return;
}
if (this.list_view.view != "Report") {
return;
}
@ -309,6 +313,10 @@ frappe.views.ListSidebar = class ListSidebar {
}
add_crm_banner() {
if (frappe.boot.sysdefaults.disable_product_suggestion == "1") {
return;
}
if (this.list_view.meta.module != "CRM" || this.list_view.view != "List") {
return;
}
@ -321,6 +329,10 @@ frappe.views.ListSidebar = class ListSidebar {
}
add_helpdesk_banner() {
if (frappe.boot.sysdefaults.disable_product_suggestion == "1") {
return;
}
if (this.list_view.meta.module != "Support" || this.list_view.view != "List") {
return;
}