I am looking to add a custom view for dashboard addition on my system.
My purpose is to have a quick overview with latest account.statement entries (per journal) with amount. It answers the query about “what is my current amount of money in bank accounts”.
The SQL query I would use (in pure sql) would be:
SELECT last.journal, last.date, end_balance FROM (SELECT journal, MAX(date) AS date FROM account_statement GROUP BY journal) AS last, account_statement WHERE last.journal = account_statement.journal AND last.date = account_statement.date;
Note that I am not using
state information as I am populating automatically Statement from bank. So I know that
draft statement are right too.
Now, I am looking to do it in the right way. Do you have advices for that ?
For now I am considering:
last_amountinformation (with Function fields)
- or having a new Model (but which type ? ModelSQL seems wrong as there is nothing to store) to query the database
Next steps for having a View and Action Window are more simple.