brotherton-erpnext/erpnext/patches/v11_0/remove_land_unit_icon.py
Ameya Shenoy 28fd02e4a8 fix(desktop_icon): remove land unit icon if exists (#15430)
* fix(desktop_icon): remove land unit icon if exists

Patch to delete the 'Land Unit' icon form 'Desktop Icon' doctype if
exists, since 'Land Unit' has been merged with 'Location'

Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>

* Update remove_land_unit_icon.py
2018-09-19 13:15:52 +05:30

18 lines
467 B
Python

# Copyright (c) 2018, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
# imports - module imports
import frappe
def execute():
"""
Delete the "Land Unit" doc if exists from "Desktop Icon" doctype
"""
try:
doc = frappe.get_doc('Desktop Icon', {'standard': 1, 'module_name': 'Land Unit'})
frappe.delete_doc('Desktop Icon', doc.name)
except frappe.ValidationError:
# The 'Land Unit' doc doesn't exist, nothing to do
pass