diff --git a/crm/fcrm/doctype/crm_list_view_settings/crm_list_view_settings.py b/crm/fcrm/doctype/crm_list_view_settings/crm_list_view_settings.py index e388373a..6ea42ff9 100644 --- a/crm/fcrm/doctype/crm_list_view_settings/crm_list_view_settings.py +++ b/crm/fcrm/doctype/crm_list_view_settings/crm_list_view_settings.py @@ -1,9 +1,26 @@ # Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt - -# import frappe +import json +import frappe from frappe.model.document import Document class CRMListViewSettings(Document): pass + + +@frappe.whitelist() +def update(doctype, columns, rows): + if not frappe.db.exists("CRM List View Settings", doctype): + # create new CRM List View Settings + doc = frappe.new_doc("CRM List View Settings") + doc.name = doctype + doc.columns = json.dumps(columns) + doc.rows = json.dumps(rows) + doc.insert() + else: + # update existing CRM List View Settings + doc = frappe.get_doc("CRM List View Settings", doctype) + doc.columns = json.dumps(columns) + doc.rows = json.dumps(rows) + doc.save() diff --git a/frontend/src/components/Icons/SettingsIcon.vue b/frontend/src/components/Icons/SettingsIcon.vue new file mode 100644 index 00000000..f7922c9a --- /dev/null +++ b/frontend/src/components/Icons/SettingsIcon.vue @@ -0,0 +1,15 @@ + diff --git a/frontend/src/components/ViewSettings.vue b/frontend/src/components/ViewSettings.vue new file mode 100644 index 00000000..89f585f6 --- /dev/null +++ b/frontend/src/components/ViewSettings.vue @@ -0,0 +1,76 @@ + + + diff --git a/frontend/src/pages/Deals.vue b/frontend/src/pages/Deals.vue index ca0b1897..f8cd613a 100644 --- a/frontend/src/pages/Deals.vue +++ b/frontend/src/pages/Deals.vue @@ -30,7 +30,7 @@
-
@@ -59,6 +59,7 @@ import DealsListView from '@/components/ListViews/DealsListView.vue' import NewDeal from '@/components/NewDeal.vue' import SortBy from '@/components/SortBy.vue' import Filter from '@/components/Filter.vue' +import ViewSettings from '@/components/ViewSettings.vue' import { usersStore } from '@/stores/users' import { organizationsStore } from '@/stores/organizations' import { useOrderBy } from '@/composables/orderby' diff --git a/frontend/src/pages/Leads.vue b/frontend/src/pages/Leads.vue index 387fa2bd..3acbce8f 100644 --- a/frontend/src/pages/Leads.vue +++ b/frontend/src/pages/Leads.vue @@ -29,7 +29,7 @@
-