mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
feat: set and update directly in update method
This commit is contained in:
parent
8378319b1b
commit
d66501968f
@ -529,7 +529,10 @@ module.exports = class BaseDocument extends Observable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
async update() {
|
async update(...args) {
|
||||||
|
if (args.length) {
|
||||||
|
await this.set(...args);
|
||||||
|
}
|
||||||
await this.compareWithCurrentDoc();
|
await this.compareWithCurrentDoc();
|
||||||
await this.commit();
|
await this.commit();
|
||||||
await this.trigger('beforeUpdate');
|
await this.trigger('beforeUpdate');
|
||||||
@ -612,7 +615,8 @@ module.exports = class BaseDocument extends Observable {
|
|||||||
}
|
}
|
||||||
let systemPrecision = frappe.SystemSettings.floatPrecision;
|
let systemPrecision = frappe.SystemSettings.floatPrecision;
|
||||||
let defaultPrecision = systemPrecision != null ? systemPrecision : 2;
|
let defaultPrecision = systemPrecision != null ? systemPrecision : 2;
|
||||||
let precision = df && df.precision != null ? df.precision : defaultPrecision;
|
let precision =
|
||||||
|
df && df.precision != null ? df.precision : defaultPrecision;
|
||||||
return round(value, precision);
|
return round(value, precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user