2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix: getChildren in CoA

This commit is contained in:
Faris Ansari 2019-12-11 17:54:32 +05:30
parent 32bed65ca2
commit 7baa7a7c59

View File

@ -120,25 +120,21 @@ export default {
return c;
},
async getChildren(parent = '') {
async getChildren(parent = null) {
const children = await frappe.db.getAll({
doctype: this.doctype,
filters: {
parentAccount: parent
},
fields: [
'name',
'parentAccount',
'isGroup',
'balance',
'rootType',
'0 as expanded'
],
fields: ['name', 'parentAccount', 'isGroup', 'balance', 'rootType'],
orderBy: 'name',
order: 'asc'
});
return children;
return children.map(d => {
d.expanded = 0;
return d;
});
},
updateBalance(balance) {
this.root.balance += balance;