|
|
@@ -32,7 +32,7 @@ |
|
|
|
from __future__ import unicode_literals |
|
|
|
|
|
|
|
import webnotes, unittest |
|
|
|
from webnotes import msgprint |
|
|
|
from webnotes import msgprint, _ |
|
|
|
from webnotes.model.bean import Bean |
|
|
|
from webnotes.model.doc import Document |
|
|
|
|
|
|
@@ -325,5 +325,9 @@ class DocTypeNestedSet(object): |
|
|
|
update_nsm(self) |
|
|
|
|
|
|
|
def on_trash(self): |
|
|
|
self.doc.fields[self.nsm_parent_field] = "" |
|
|
|
parent = self.doc.fields[self.nsm_parent_field] |
|
|
|
if not parent: |
|
|
|
msgprint(_("Root ") + self.doc.doctype + _(" cannot be deleted."), raise_exception=1) |
|
|
|
|
|
|
|
parent = "" |
|
|
|
update_nsm(self) |