2
0
mirror of https://github.com/frappe/books.git synced 2025-01-12 11:04:12 +00:00

fix: Return docfields list in getQuickEditFields

This commit is contained in:
Faris Ansari 2019-10-19 20:07:24 +05:30
parent a06828683a
commit 9ca6c99012

View File

@ -25,6 +25,16 @@ module.exports = class BaseMeta extends BaseDocument {
setValues(data) {
Object.assign(this, data);
if (!this.fields.find(df => df.fieldname === 'name')) {
this.fields = [
{
label: frappe._('Name'),
fieldname: 'name',
fieldtype: 'Data',
required: 1
}
].concat(this.fields);
}
}
hasField(fieldname) {
@ -213,7 +223,10 @@ module.exports = class BaseMeta extends BaseDocument {
}
getQuickEditFields() {
return this.quickEditFields || this.getKeywordFields();
if (this.quickEditFields) {
return this.quickEditFields.map(fieldname => this.getField(fieldname));
}
return this.getFieldsWith({ required: 1 });
}
validateSelect(field, value) {