From b0a84f014ee34e3cb4e5e178c7c7209b38f46dae Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Thu, 20 Dec 2018 20:12:37 +0530 Subject: [PATCH] Replace desktop icon for project list with desktop icon for projects module - Add a patch to fix already install instances --- erpnext/config/desktop.py | 6 ++--- erpnext/patches.txt | 1 + ..._icon_with_projects_module_desktop_icon.py | 24 +++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 erpnext/patches/v11_0/replace_project_list_desktop_icon_with_projects_module_desktop_icon.py diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py index cdb2e75ac8..2f589ab682 100644 --- a/erpnext/config/desktop.py +++ b/erpnext/config/desktop.py @@ -38,12 +38,10 @@ def get_data(): "link": "List/Employee" }, { - "module_name": "Project", - "_doctype": "Project", + "module_name": "Projects", "color": "#8e44ad", "icon": "octicon octicon-rocket", - "type": "link", - "link": "List/Project" + "type": "module", }, { "module_name": "Issue", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 4a67eb4e47..847182f77e 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -579,3 +579,4 @@ erpnext.patches.v10_0.update_user_image_in_employee erpnext.patches.v11_0.update_delivery_trip_status erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items erpnext.patches.v11_0.set_missing_gst_hsn_code +erpnext.patches.v11_0.replace_project_list_desktop_icon_with_projects_module_desktop_icon diff --git a/erpnext/patches/v11_0/replace_project_list_desktop_icon_with_projects_module_desktop_icon.py b/erpnext/patches/v11_0/replace_project_list_desktop_icon_with_projects_module_desktop_icon.py new file mode 100644 index 0000000000..daa6725f4d --- /dev/null +++ b/erpnext/patches/v11_0/replace_project_list_desktop_icon_with_projects_module_desktop_icon.py @@ -0,0 +1,24 @@ +import frappe + +def execute(): + frappe.db.sql("""DELETE + FROM `tabDesktop Icon` + WHERE + `module_name` in ('Project', 'Projects') AND + `standard`=1 AND + `app`='erpnext' + """) + + desktop_icon = frappe.get_doc({ + 'doctype': 'Desktop Icon', + 'idx': 5, + 'standard': 1, + 'app': 'erpnext', + 'owner': 'Administrator', + 'module_name': 'Projects', + 'color': '#8e44ad', + 'icon': 'octicon octicon-rocket', + 'type': 'module' + }) + + desktop_icon.save()