mirror of
https://github.com/frappe/books.git
synced 2024-11-13 00:46:28 +00:00
tabs -> spaces
This commit is contained in:
parent
8475b83d2d
commit
b436aa617c
@ -29,7 +29,7 @@ module.exports = class BaseDocument {
|
|||||||
// set value and trigger change
|
// set value and trigger change
|
||||||
async set(fieldname, value) {
|
async set(fieldname, value) {
|
||||||
this[fieldname] = await this.validate_field(fieldname, value);
|
this[fieldname] = await this.validate_field(fieldname, value);
|
||||||
await this.trigger('change', {doc: this, fieldname: fieldname, value: value});
|
await this.trigger('change', { doc: this, fieldname: fieldname, value: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
set_name() {
|
set_name() {
|
||||||
@ -70,9 +70,9 @@ module.exports = class BaseDocument {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async validate_field (key, value) {
|
async validate_field(key, value) {
|
||||||
let field = this.meta.get_field(key);
|
let field = this.meta.get_field(key);
|
||||||
if (field && field.fieldtype=='Select') {
|
if (field && field.fieldtype == 'Select') {
|
||||||
return this.meta.validate_select(field, value);
|
return this.meta.validate_select(field, value);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
@ -80,7 +80,7 @@ module.exports = class BaseDocument {
|
|||||||
|
|
||||||
get_valid_dict() {
|
get_valid_dict() {
|
||||||
let doc = {};
|
let doc = {};
|
||||||
for(let field of this.meta.get_valid_fields()) {
|
for (let field of this.meta.get_valid_fields()) {
|
||||||
doc[field.fieldname] = this.get(field.fieldname);
|
doc[field.fieldname] = this.get(field.fieldname);
|
||||||
}
|
}
|
||||||
return doc;
|
return doc;
|
||||||
|
@ -25,7 +25,7 @@ module.exports = class BaseMeta extends BaseDocument {
|
|||||||
|
|
||||||
get_table_fields() {
|
get_table_fields() {
|
||||||
if (!this._table_fields) {
|
if (!this._table_fields) {
|
||||||
this._table_fields = this.fields.filter(field => field.fieldtype==='Table');
|
this._table_fields = this.fields.filter(field => field.fieldtype === 'Table');
|
||||||
}
|
}
|
||||||
return this._table_fields;
|
return this._table_fields;
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ module.exports = class BaseMeta extends BaseDocument {
|
|||||||
return this[fieldname];
|
return this[fieldname];
|
||||||
}
|
}
|
||||||
|
|
||||||
get_valid_fields({with_children = true} = {}) {
|
get_valid_fields({ with_children = true } = {}) {
|
||||||
if (!this._valid_fields) {
|
if (!this._valid_fields) {
|
||||||
this._valid_fields = [];
|
this._valid_fields = [];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user