mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +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;
|
||||
}
|
||||
|
||||
async update() {
|
||||
async update(...args) {
|
||||
if (args.length) {
|
||||
await this.set(...args);
|
||||
}
|
||||
await this.compareWithCurrentDoc();
|
||||
await this.commit();
|
||||
await this.trigger('beforeUpdate');
|
||||
@ -612,7 +615,8 @@ module.exports = class BaseDocument extends Observable {
|
||||
}
|
||||
let systemPrecision = frappe.SystemSettings.floatPrecision;
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user