From 11436f63b625087f4894e353e4c1743a19ee1ade Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sat, 16 Mar 2024 13:42:32 +0530 Subject: [PATCH] fix: renamed CRM Note to FCRM Note --- crm/api/activities.py | 2 +- crm/fcrm/doctype/crm_call_log/crm_call_log.json | 4 ++-- crm/fcrm/doctype/crm_call_log/crm_call_log.py | 4 ++-- crm/fcrm/doctype/{crm_note => fcrm_note}/__init__.py | 0 .../doctype/{crm_note/crm_note.js => fcrm_note/fcrm_note.js} | 2 +- .../{crm_note/crm_note.json => fcrm_note/fcrm_note.json} | 2 +- .../doctype/{crm_note/crm_note.py => fcrm_note/fcrm_note.py} | 2 +- .../test_crm_note.py => fcrm_note/test_fcrm_note.py} | 2 +- crm/twilio/api.py | 4 ++-- frontend/src/components/Activities.vue | 2 +- frontend/src/components/Modals/NoteModal.vue | 4 ++-- frontend/src/pages/CallLog.vue | 2 +- frontend/src/pages/Notes.vue | 4 ++-- 13 files changed, 17 insertions(+), 17 deletions(-) rename crm/fcrm/doctype/{crm_note => fcrm_note}/__init__.py (100%) rename crm/fcrm/doctype/{crm_note/crm_note.js => fcrm_note/fcrm_note.js} (81%) rename crm/fcrm/doctype/{crm_note/crm_note.json => fcrm_note/fcrm_note.json} (98%) rename crm/fcrm/doctype/{crm_note/crm_note.py => fcrm_note/fcrm_note.py} (93%) rename crm/fcrm/doctype/{crm_note/test_crm_note.py => fcrm_note/test_fcrm_note.py} (81%) diff --git a/crm/api/activities.py b/crm/api/activities.py index c458a383..d04678d2 100644 --- a/crm/api/activities.py +++ b/crm/api/activities.py @@ -313,7 +313,7 @@ def get_linked_calls(name): def get_linked_notes(name): notes = frappe.db.get_all( - "CRM Note", + "FCRM Note", filters={"reference_docname": name}, fields=['name', 'title', 'content', 'owner', 'modified'], ) diff --git a/crm/fcrm/doctype/crm_call_log/crm_call_log.json b/crm/fcrm/doctype/crm_call_log/crm_call_log.json index 6cb6191c..ebefc2ab 100644 --- a/crm/fcrm/doctype/crm_call_log/crm_call_log.json +++ b/crm/fcrm/doctype/crm_call_log/crm_call_log.json @@ -95,7 +95,7 @@ "fieldname": "note", "fieldtype": "Link", "label": "Note", - "options": "CRM Note" + "options": "FCRM Note" }, { "depends_on": "eval:doc.type == 'Incoming'", @@ -127,7 +127,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-01-19 21:51:52.173476", + "modified": "2024-03-16 13:23:09.201843", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Call Log", diff --git a/crm/fcrm/doctype/crm_call_log/crm_call_log.py b/crm/fcrm/doctype/crm_call_log/crm_call_log.py index 8d61dde3..200a8545 100644 --- a/crm/fcrm/doctype/crm_call_log/crm_call_log.py +++ b/crm/fcrm/doctype/crm_call_log/crm_call_log.py @@ -80,7 +80,7 @@ def get_call_log(name): if doc.lead: doc.lead_name = frappe.db.get_value("CRM Lead", doc.lead, "lead_name") if doc.note: - note = frappe.db.get_values("CRM Note", doc.note, ["title", "content"])[0] + note = frappe.db.get_values("FCRM Note", doc.note, ["title", "content"])[0] doc.note_doc = { "name": doc.note, "title": note[0], @@ -100,6 +100,6 @@ def create_lead_from_call_log(call_log): frappe.db.set_value("CRM Call Log", call_log.get("name"), "lead", lead.name) if call_log.get("note"): - frappe.db.set_value("CRM Note", call_log.get("note"), "lead", lead.name) + frappe.db.set_value("FCRM Note", call_log.get("note"), "lead", lead.name) return lead.name \ No newline at end of file diff --git a/crm/fcrm/doctype/crm_note/__init__.py b/crm/fcrm/doctype/fcrm_note/__init__.py similarity index 100% rename from crm/fcrm/doctype/crm_note/__init__.py rename to crm/fcrm/doctype/fcrm_note/__init__.py diff --git a/crm/fcrm/doctype/crm_note/crm_note.js b/crm/fcrm/doctype/fcrm_note/fcrm_note.js similarity index 81% rename from crm/fcrm/doctype/crm_note/crm_note.js rename to crm/fcrm/doctype/fcrm_note/fcrm_note.js index 48bab216..843e8f73 100644 --- a/crm/fcrm/doctype/crm_note/crm_note.js +++ b/crm/fcrm/doctype/fcrm_note/fcrm_note.js @@ -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 Note", { +// frappe.ui.form.on("FCRM Note", { // refresh(frm) { // }, diff --git a/crm/fcrm/doctype/crm_note/crm_note.json b/crm/fcrm/doctype/fcrm_note/fcrm_note.json similarity index 98% rename from crm/fcrm/doctype/crm_note/crm_note.json rename to crm/fcrm/doctype/fcrm_note/fcrm_note.json index 3726bdd2..fc458fec 100644 --- a/crm/fcrm/doctype/crm_note/crm_note.json +++ b/crm/fcrm/doctype/fcrm_note/fcrm_note.json @@ -52,7 +52,7 @@ "modified": "2024-01-19 21:56:30.123334", "modified_by": "Administrator", "module": "FCRM", - "name": "CRM Note", + "name": "FCRM Note", "owner": "Administrator", "permissions": [ { diff --git a/crm/fcrm/doctype/crm_note/crm_note.py b/crm/fcrm/doctype/fcrm_note/fcrm_note.py similarity index 93% rename from crm/fcrm/doctype/crm_note/crm_note.py rename to crm/fcrm/doctype/fcrm_note/fcrm_note.py index 241146b3..c81538d8 100644 --- a/crm/fcrm/doctype/crm_note/crm_note.py +++ b/crm/fcrm/doctype/fcrm_note/fcrm_note.py @@ -5,7 +5,7 @@ from frappe.model.document import Document -class CRMNote(Document): +class FCRMNote(Document): @staticmethod def default_list_data(): rows = [ diff --git a/crm/fcrm/doctype/crm_note/test_crm_note.py b/crm/fcrm/doctype/fcrm_note/test_fcrm_note.py similarity index 81% rename from crm/fcrm/doctype/crm_note/test_crm_note.py rename to crm/fcrm/doctype/fcrm_note/test_fcrm_note.py index af69a47d..86635b28 100644 --- a/crm/fcrm/doctype/crm_note/test_crm_note.py +++ b/crm/fcrm/doctype/fcrm_note/test_fcrm_note.py @@ -5,5 +5,5 @@ from frappe.tests.utils import FrappeTestCase -class TestCRMNote(FrappeTestCase): +class TestFCRMNote(FrappeTestCase): pass diff --git a/crm/twilio/api.py b/crm/twilio/api.py index 7acaec91..1ea4d67d 100644 --- a/crm/twilio/api.py +++ b/crm/twilio/api.py @@ -88,8 +88,8 @@ def update_call_log(call_sid, status=None): call_log.start_time = get_datetime_from_timestamp(call_details.start_time) call_log.end_time = get_datetime_from_timestamp(call_details.end_time) if call_log.note and call_log.reference_docname: - frappe.db.set_value("CRM Note", call_log.note, "reference_doctype", call_log.reference_doctype) - frappe.db.set_value("CRM Note", call_log.note, "reference_docname", call_log.reference_docname) + frappe.db.set_value("FCRM Note", call_log.note, "reference_doctype", call_log.reference_doctype) + frappe.db.set_value("FCRM Note", call_log.note, "reference_docname", call_log.reference_docname) call_log.flags.ignore_permissions = True call_log.save() frappe.db.commit() diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index 18b53038..3e731dc9 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -1002,7 +1002,7 @@ function showNote(n) { async function deleteNote(name) { await call('frappe.client.delete', { - doctype: 'CRM Note', + doctype: 'FCRM Note', name, }) all_activities.reload() diff --git a/frontend/src/components/Modals/NoteModal.vue b/frontend/src/components/Modals/NoteModal.vue index b4226922..05defd4c 100644 --- a/frontend/src/components/Modals/NoteModal.vue +++ b/frontend/src/components/Modals/NoteModal.vue @@ -101,7 +101,7 @@ async function updateNote() { if (_note.value.name) { let d = await call('frappe.client.set_value', { - doctype: 'CRM Note', + doctype: 'FCRM Note', name: _note.value.name, fieldname: _note.value, }) @@ -112,7 +112,7 @@ async function updateNote() { } else { let d = await call('frappe.client.insert', { doc: { - doctype: 'CRM Note', + doctype: 'FCRM Note', title: _note.value.title, content: _note.value.content, reference_doctype: props.doctype, diff --git a/frontend/src/pages/CallLog.vue b/frontend/src/pages/CallLog.vue index 64f46085..14aed0f4 100644 --- a/frontend/src/pages/CallLog.vue +++ b/frontend/src/pages/CallLog.vue @@ -216,7 +216,7 @@ const callLog = createResource({ async function updateNote(_note) { if (_note.title || _note.content) { let d = await call('frappe.client.set_value', { - doctype: 'CRM Note', + doctype: 'FCRM Note', name: callLog.data?.note, fieldname: _note, }) diff --git a/frontend/src/pages/Notes.vue b/frontend/src/pages/Notes.vue index 93e676be..065d9bfe 100644 --- a/frontend/src/pages/Notes.vue +++ b/frontend/src/pages/Notes.vue @@ -13,7 +13,7 @@ v-model="notes" v-model:loadMore="loadMore" v-model:updatedPageCount="updatedPageCount" - doctype="CRM Note" + doctype="FCRM Note" :options="{ hideColumnsButton: true, defaultViewName: 'Notes View', @@ -159,7 +159,7 @@ function editNote(note) { async function deleteNote(name) { await call('frappe.client.delete', { - doctype: 'CRM Note', + doctype: 'FCRM Note', name, }) notes.value.reload()