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''' diff --git a/erpnext/patches.txt b/erpnext/patches.txt index fb4e0baade..78090e59a2 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -460,3 +460,4 @@ execute:frappe.delete_doc_if_exists("DocType", "Program Fee") 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