mirror of
https://github.com/frappe/books.git
synced 2025-02-02 20:18:26 +00:00
fix: getChildren in CoA
This commit is contained in:
parent
32bed65ca2
commit
7baa7a7c59
@ -120,25 +120,21 @@ export default {
|
|||||||
|
|
||||||
return c;
|
return c;
|
||||||
},
|
},
|
||||||
async getChildren(parent = '') {
|
async getChildren(parent = null) {
|
||||||
const children = await frappe.db.getAll({
|
const children = await frappe.db.getAll({
|
||||||
doctype: this.doctype,
|
doctype: this.doctype,
|
||||||
filters: {
|
filters: {
|
||||||
parentAccount: parent
|
parentAccount: parent
|
||||||
},
|
},
|
||||||
fields: [
|
fields: ['name', 'parentAccount', 'isGroup', 'balance', 'rootType'],
|
||||||
'name',
|
|
||||||
'parentAccount',
|
|
||||||
'isGroup',
|
|
||||||
'balance',
|
|
||||||
'rootType',
|
|
||||||
'0 as expanded'
|
|
||||||
],
|
|
||||||
orderBy: 'name',
|
orderBy: 'name',
|
||||||
order: 'asc'
|
order: 'asc'
|
||||||
});
|
});
|
||||||
|
|
||||||
return children;
|
return children.map(d => {
|
||||||
|
d.expanded = 0;
|
||||||
|
return d;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
updateBalance(balance) {
|
updateBalance(balance) {
|
||||||
this.root.balance += balance;
|
this.root.balance += balance;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user