data = [{'account_type': u'account_type', 'balance': 3484382.4899999998, 'type': 'report', 'name': u'Assets', 'level': 1}, {'account_type': u'liquidity', 'balance': 87301.78, 'type': 'account', 'name': u'100101 Cash', 'level': 4}, {'account_type': u'liquidity', 'balance': 257350.98, 'type': 'account', 'name': u'100201 HDFC Bank', 'level': 4}]
@api.multi
def account_fun():
for item in data:
return item['balance']
i'm calling that function using compute and getting the error expected singleton. but i want store all the balance from data into the database by one by one. in account.account table in odoo .
balance = field.Float(string="Balance",compute="account_fun")#creating new balance field.
how can i do that.and have to show balance field in list view. thanks,
I am not sure what you are trying to do with that logic, I have just give you idea here how you can do it.