diff --git a/src/components/Form/Form.vue b/src/components/Form/Form.vue
index e3b66a53..386c2db7 100644
--- a/src/components/Form/Form.vue
+++ b/src/components/Form/Form.vue
@@ -4,7 +4,7 @@
v-if="shouldRenderForm"
:doctype="doctype"
:name="name"
- :title="doc[meta.titleField]"
+ :title="formTitle"
@save="save"
/>
@@ -23,6 +23,7 @@
import frappe from 'frappejs';
import FormLayout from './FormLayout';
import FormActions from './FormActions';
+import { _ } from 'frappejs/utils';
export default {
name: 'Form',
@@ -45,6 +46,12 @@ export default {
},
shouldRenderForm() {
return this.name && this.docLoaded;
+ },
+ formTitle() {
+ if (this.doc._notInserted) {
+ return _('New {0}', _(this.doctype));
+ }
+ return this.doc[this.meta.titleField];
}
},
async created() {