fix: renamed list view settings to view settings
This commit is contained in:
parent
f383791b42
commit
4aa0c1402f
@ -59,8 +59,8 @@ def get_list_data(doctype: str, filters: dict, order_by: str):
|
|||||||
|
|
||||||
is_default = True
|
is_default = True
|
||||||
|
|
||||||
if frappe.db.exists("CRM List View Settings", doctype):
|
if frappe.db.exists("CRM View Settings", doctype):
|
||||||
list_view_settings = frappe.get_doc("CRM List View Settings", doctype)
|
list_view_settings = frappe.get_doc("CRM View Settings", doctype)
|
||||||
columns = frappe.parse_json(list_view_settings.columns)
|
columns = frappe.parse_json(list_view_settings.columns)
|
||||||
rows = frappe.parse_json(list_view_settings.rows)
|
rows = frappe.parse_json(list_view_settings.rows)
|
||||||
is_default = False
|
is_default = False
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
// frappe.ui.form.on("CRM List View Settings", {
|
// frappe.ui.form.on("CRM View Settings", {
|
||||||
// refresh(frm) {
|
// refresh(frm) {
|
||||||
|
|
||||||
// },
|
// },
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"modified": "2023-11-28 00:17:42.675332",
|
"modified": "2023-11-28 00:17:42.675332",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM List View Settings",
|
"name": "CRM View Settings",
|
||||||
"naming_rule": "Set by user",
|
"naming_rule": "Set by user",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
@ -5,7 +5,7 @@ import frappe
|
|||||||
from frappe.model.document import Document, get_controller
|
from frappe.model.document import Document, get_controller
|
||||||
|
|
||||||
|
|
||||||
class CRMListViewSettings(Document):
|
class CRMViewSettings(Document):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -18,16 +18,16 @@ def update(doctype, columns, rows):
|
|||||||
|
|
||||||
rows = remove_duplicates(rows)
|
rows = remove_duplicates(rows)
|
||||||
|
|
||||||
if not frappe.db.exists("CRM List View Settings", doctype):
|
if not frappe.db.exists("CRM View Settings", doctype):
|
||||||
# create new CRM List View Settings
|
# create new CRM View Settings
|
||||||
doc = frappe.new_doc("CRM List View Settings")
|
doc = frappe.new_doc("CRM View Settings")
|
||||||
doc.name = doctype
|
doc.name = doctype
|
||||||
doc.columns = json.dumps(columns)
|
doc.columns = json.dumps(columns)
|
||||||
doc.rows = json.dumps(rows)
|
doc.rows = json.dumps(rows)
|
||||||
doc.insert()
|
doc.insert()
|
||||||
else:
|
else:
|
||||||
# update existing CRM List View Settings
|
# update existing CRM View Settings
|
||||||
doc = frappe.get_doc("CRM List View Settings", doctype)
|
doc = frappe.get_doc("CRM View Settings", doctype)
|
||||||
doc.columns = json.dumps(columns)
|
doc.columns = json.dumps(columns)
|
||||||
doc.rows = json.dumps(rows)
|
doc.rows = json.dumps(rows)
|
||||||
doc.save()
|
doc.save()
|
||||||
@ -46,5 +46,5 @@ def sync_default_list_rows(doctype):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def reset_to_default(doctype):
|
def reset_to_default(doctype):
|
||||||
if frappe.db.exists("CRM List View Settings", doctype):
|
if frappe.db.exists("CRM View Settings", doctype):
|
||||||
frappe.delete_doc("CRM List View Settings", doctype)
|
frappe.delete_doc("CRM View Settings", doctype)
|
||||||
@ -5,5 +5,5 @@
|
|||||||
from frappe.tests.utils import FrappeTestCase
|
from frappe.tests.utils import FrappeTestCase
|
||||||
|
|
||||||
|
|
||||||
class TestCRMListViewSettings(FrappeTestCase):
|
class TestCRMViewSettings(FrappeTestCase):
|
||||||
pass
|
pass
|
||||||
@ -228,7 +228,7 @@ function cancelUpdate() {
|
|||||||
async function updateColumnDetails() {
|
async function updateColumnDetails() {
|
||||||
is_default.value = false
|
is_default.value = false
|
||||||
await call(
|
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,
|
doctype: props.doctype,
|
||||||
columns: columns.value,
|
columns: columns.value,
|
||||||
@ -239,7 +239,7 @@ async function updateColumnDetails() {
|
|||||||
|
|
||||||
async function resetToDefault() {
|
async function resetToDefault() {
|
||||||
await call(
|
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,
|
doctype: props.doctype,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user