diff --git a/js/legacy/utils/msgprint.js b/js/legacy/utils/msgprint.js
index 089273755a..a89995d9c0 100644
--- a/js/legacy/utils/msgprint.js
+++ b/js/legacy/utils/msgprint.js
@@ -27,7 +27,9 @@ function msgprint(msg, title) {
if(msg instanceof Array) {
$.each(msg, function(i,v) {
- if(v)msgprint(v);
+ if(v) {
+ msgprint(v);
+ }
})
return;
}
@@ -55,6 +57,10 @@ function msgprint(msg, title) {
msg = replace_newlines(msg);
msg_dialog.set_title(title || 'Message')
+
+ // append a
if another msg already exists
+ if(msg_dialog.msg_area.html()) msg_dialog.msg_area.append("
");
+
msg_dialog.msg_area.append(msg);
msg_dialog.show();
diff --git a/py/core/doctype/custom_field/custom_field.py b/py/core/doctype/custom_field/custom_field.py
index 6b9c79916b..1371f47976 100644
--- a/py/core/doctype/custom_field/custom_field.py
+++ b/py/core/doctype/custom_field/custom_field.py
@@ -45,7 +45,7 @@ class DocType:
exists = any(d for d in doctype_doclist if d.doctype == 'DocField' and
(d.fields.get('label') == self.doc.label or
d.fields.get('fieldname') == self.doc.fieldname))
- if self.doc.__islocal == 1 and exists:
+ if self.doc.fields.get('__islocal') and exists:
msgprint("%s field already exists in Document : %s" % (self.doc.label, self.doc.dt))
raise Exception