diff --git a/erpnext/projects/doctype/activity_type/activity_type.py b/erpnext/projects/doctype/activity_type/activity_type.py index 7e316b532d1..cc43e8249aa 100644 --- a/erpnext/projects/doctype/activity_type/activity_type.py +++ b/erpnext/projects/doctype/activity_type/activity_type.py @@ -3,14 +3,17 @@ from __future__ import unicode_literals import frappe - +from frappe import _ from frappe.model.document import Document class ActivityType(Document): def on_trash(self): self.validate_manufacturing_type() - + + def before_rename(self, olddn, newdn, merge=False): + self.validate_manufacturing_type() + def validate_manufacturing_type(self): if self.activity_type == 'Manufacturing': - frappe.throw(_("Activity Type 'Manufacturing' cannot be deleted.")) \ No newline at end of file + frappe.throw(_("Activity Type 'Manufacturing' cannot be deleted/renamed.")) \ No newline at end of file