From 42274a4591abcc8ec61f0a921eb79c7b1b1a6a55 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 14 Nov 2017 17:15:11 +0530 Subject: [PATCH 1/2] Delete healthcare domain items (#11567) --- erpnext/patches.txt | 1 + erpnext/patches/v9_2/__init__.py | 0 .../delete_healthcare_domain_default_items.py | 16 ++++++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 erpnext/patches/v9_2/__init__.py create mode 100644 erpnext/patches/v9_2/delete_healthcare_domain_default_items.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 8d7ca10a19..ca8b0ecb54 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -458,3 +458,4 @@ erpnext.patches.v9_0.copy_old_fees_field_data erpnext.patches.v9_0.set_pos_profile_name erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings execute:frappe.delete_doc_if_exists("DocType", "Program Fee") +erpnext.patches.v9_2.delete_healthcare_domain_default_items \ No newline at end of file diff --git a/erpnext/patches/v9_2/__init__.py b/erpnext/patches/v9_2/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/patches/v9_2/delete_healthcare_domain_default_items.py b/erpnext/patches/v9_2/delete_healthcare_domain_default_items.py new file mode 100644 index 0000000000..187cbd3f9a --- /dev/null +++ b/erpnext/patches/v9_2/delete_healthcare_domain_default_items.py @@ -0,0 +1,16 @@ +import frappe +from frappe.utils import getdate + +def execute(): + domain_settings = frappe.get_doc('Domain Settings') + active_domains = [d.domain for d in domain_settings.active_domains] + + if "Healthcare" not in active_domains: + items = ["TTT", "MCH", "LDL", "GTT", "HDL", "BILT", "BILD", "BP", "BS"] + for item_code in items: + try: + item = frappe.db.get_value("Item", {"item_code": item_code}, ["name", "creation"], as_dict=1) + if item and getdate(item.creation) >= getdate("2017-11-10"): + frappe.delete_doc("Item", item.name) + except: + pass \ No newline at end of file From ea3e6b93a7c6321655687184a8381ab0135e6b20 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 14 Nov 2017 18:18:42 +0600 Subject: [PATCH 2/2] bumped to version 9.2.12 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 334af63671..f7761ac851 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.2.11' +__version__ = '9.2.12' def get_default_company(user=None): '''Get default company for user'''