mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +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
|
||||
async set(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() {
|
||||
@ -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);
|
||||
if (field && field.fieldtype=='Select') {
|
||||
if (field && field.fieldtype == 'Select') {
|
||||
return this.meta.validate_select(field, value);
|
||||
}
|
||||
return value;
|
||||
@ -80,7 +80,7 @@ module.exports = class BaseDocument {
|
||||
|
||||
get_valid_dict() {
|
||||
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);
|
||||
}
|
||||
return doc;
|
||||
|
@ -25,7 +25,7 @@ module.exports = class BaseMeta extends BaseDocument {
|
||||
|
||||
get_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;
|
||||
}
|
||||
@ -46,7 +46,7 @@ module.exports = class BaseMeta extends BaseDocument {
|
||||
return this[fieldname];
|
||||
}
|
||||
|
||||
get_valid_fields({with_children = true} = {}) {
|
||||
get_valid_fields({ with_children = true } = {}) {
|
||||
if (!this._valid_fields) {
|
||||
this._valid_fields = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user