commit | 621529adfbf5fb2e1ab1161f6e6d99a275e28ae7 | [log] [tgz] |
---|---|---|
author | Rucha Mahabal <ruchamahabal2@gmail.com> | Thu Jul 30 13:18:41 2020 +0530 |
committer | GitHub <noreply@github.com> | Thu Jul 30 13:18:41 2020 +0530 |
tree | 7488e79adcbbf27ff17ff5d1b16ef5f52ed4ab95 | |
parent | 00f25842d08cd1f7801bbf234e7b5bbe91af4547 [diff] |
fix: unlink item from healthcare service unit type (#22828) Co-authored-by: Marica <maricadsouza221197@gmail.com>
diff --git a/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py b/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py index bb86eaa..a318e50 100644 --- a/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py +++ b/erpnext/healthcare/doctype/healthcare_service_unit_type/healthcare_service_unit_type.py
@@ -39,7 +39,9 @@ def on_trash(self): if self.item: try: - frappe.delete_doc('Item', self.item) + item = self.item + self.db_set('item', '') + frappe.delete_doc('Item', item) except Exception: frappe.throw(_('Not permitted. Please disable the Service Unit Type'))