2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
For a new form, if there is an editable name field, then it should
be set to blank from auto-generated name
This commit is contained in:
Faris Ansari 2018-07-09 15:15:40 +05:30
parent a7ed751d48
commit a8416dc4fe

View File

@ -63,6 +63,13 @@ export default {
this.doc.on('change', () => {
this.isDirty = this.doc._dirty;
});
if (this.doc._notInserted && this.meta.fields.map(df => df.fieldname).includes('name')) {
// For a user editable name field,
// it should be unset since it is autogenerated
this.doc.set('name', '');
}
this.docLoaded = true;
} catch(e) {
this.notFound = true;