fix: renamed list view settings to view settings

This commit is contained in:
Shariq Ansari 2023-12-29 15:07:20 +05:30
parent f383791b42
commit 4aa0c1402f
7 changed files with 15 additions and 15 deletions

View File

@ -59,8 +59,8 @@ def get_list_data(doctype: str, filters: dict, order_by: str):
is_default = True
if frappe.db.exists("CRM List View Settings", doctype):
list_view_settings = frappe.get_doc("CRM List View Settings", doctype)
if frappe.db.exists("CRM View Settings", doctype):
list_view_settings = frappe.get_doc("CRM View Settings", doctype)
columns = frappe.parse_json(list_view_settings.columns)
rows = frappe.parse_json(list_view_settings.rows)
is_default = False

View File

@ -1,7 +1,7 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
// frappe.ui.form.on("CRM List View Settings", {
// frappe.ui.form.on("CRM View Settings", {
// refresh(frm) {
// },

View File

@ -33,7 +33,7 @@
"modified": "2023-11-28 00:17:42.675332",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM List View Settings",
"name": "CRM View Settings",
"naming_rule": "Set by user",
"owner": "Administrator",
"permissions": [

View File

@ -5,7 +5,7 @@ import frappe
from frappe.model.document import Document, get_controller
class CRMListViewSettings(Document):
class CRMViewSettings(Document):
pass
@ -18,16 +18,16 @@ def update(doctype, columns, rows):
rows = remove_duplicates(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")
if not frappe.db.exists("CRM View Settings", doctype):
# create new CRM View Settings
doc = frappe.new_doc("CRM 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)
# update existing CRM View Settings
doc = frappe.get_doc("CRM View Settings", doctype)
doc.columns = json.dumps(columns)
doc.rows = json.dumps(rows)
doc.save()
@ -46,5 +46,5 @@ def sync_default_list_rows(doctype):
@frappe.whitelist()
def reset_to_default(doctype):
if frappe.db.exists("CRM List View Settings", doctype):
frappe.delete_doc("CRM List View Settings", doctype)
if frappe.db.exists("CRM View Settings", doctype):
frappe.delete_doc("CRM View Settings", doctype)

View File

@ -5,5 +5,5 @@
from frappe.tests.utils import FrappeTestCase
class TestCRMListViewSettings(FrappeTestCase):
class TestCRMViewSettings(FrappeTestCase):
pass

View File

@ -228,7 +228,7 @@ function cancelUpdate() {
async function updateColumnDetails() {
is_default.value = false
await call(
'crm.fcrm.doctype.crm_list_view_settings.crm_list_view_settings.update',
'crm.fcrm.doctype.crm_view_settings.crm_view_settings.update',
{
doctype: props.doctype,
columns: columns.value,
@ -239,7 +239,7 @@ async function updateColumnDetails() {
async function resetToDefault() {
await call(
'crm.fcrm.doctype.crm_list_view_settings.crm_list_view_settings.reset_to_default',
'crm.fcrm.doctype.crm_view_settings.crm_view_settings.reset_to_default',
{
doctype: props.doctype,
}