Improve account type amount performance
The computation of the account.account.type amount reads the debit and credit debits of the related accounts. This fields can computed using a single function (using single query) but as the code call them in diferent lines the function is called one time for each field.
On big database the computation of this query can spend long time because a big number of values should be summed (We mesured 700ms per query on our of our customers database). Computing both fields in a single call reduces the time to compute by a half as the data needs to be scanned only once.
In this case I think we should use search_read to read both values into a single call, which means computing both values into a single query and reducing the time to compute the amount of a type.