mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-12 14:58:24 +00:00
Validate renaming of activity type - manufacturing
This commit is contained in:
@@ -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."))
|
||||
frappe.throw(_("Activity Type 'Manufacturing' cannot be deleted/renamed."))
|
||||
Reference in New Issue
Block a user