Skip to content
We're live on the Odoo App StoreView listing ↗

Edit a template's column

The tiles and table columns of a template dashboard are custom fields: SQL expressions written for each widget. The custom field wizard opens each one in the form when it can show it exactly, and on the SQL tab when it can’t. Either way, nothing is rewritten until you change it.

This recipe opens three of them on the Balance Sheet template. Install it first from Configurations → Dashboard Builder → Templates (it needs Invoicing).

  1. In the Dashboard Builder, open the Balance Sheet dashboard and click the widget in Analytics Items.

  2. On the Configuration tab, click the field: Data Field on a tile, or the column’s field in Table Columns Configuration.

  3. At the bottom of the list, pick Edit Custom Field.

If you click Apply without changing anything, the field is kept exactly as it was and Save & Preview has nothing to save.

The Total Assets tile opens on the Condition tab. Wrap Result is SUM( … ), so the tile adds up one value per journal item: its balance when account_type is one of the asset types, and 0 otherwise.

Edit Custom Field for Total Assets: Condition tab, Wrap Result SUM( … ) totalling the per-row result as SUM( CASE … END ), When account_type is one of the values asset_cash, asset_receivable, asset_…, Then Field balance, Otherwise Value 0

To change which accounts count as assets, edit the list after Values. Type the account types separated by commas, without quotes; the wizard adds them. For example, delete asset_prepayments to leave prepaid expenses out.

Total Liabilities, Equity and Unallocated Earnings open the same way, with Negate ticked: those balances are stored as credits, so the tile multiplies the total by −1 to show them as positive amounts.

The table’s Group column: “is one of” lists

Section titled “The table’s Group column: “is one of” lists”

The table’s first column, Group, puts every account under Assets, Liabilities or Equity. It opens on the Condition tab with one branch per heading, each matching a list of account types, and Equity as the Otherwise value.

Edit Custom Field for the Group column: When account_type is one of asset_cash, asset_receivable, asset_… then Value Assets; Else When account_type is one of liability_current, liability_credit… then Value Liabilities; Otherwise Value Equity

Change a heading by editing its Then value, or move an account type from one list to another. The table groups by this column, so a new heading becomes a new group in the table.

Current Ratio divides current assets by current liabilities and rounds the result. The form has no way to show a ROUND(…) around a division, so the field opens on the SQL tab with the template’s text as it is.

Edit Custom Field for Current Ratio on the SQL tab: ROUND((SUM(CASE WHEN account_type IN (…) THEN balance ELSE 0 END) / NULLIF(-SUM(CASE WHEN account_type IN (…) THEN balance ELSE 0 END), 0))::numeric, 2), with the dataset's fields as chips below

Edit the text directly. To insert a column name, put the cursor where it goes and click the column under Fields. Open in visual builder leaves it on the SQL tab with a note, because the form can’t show it. The checks the wizard runs on SQL (balanced brackets and quotes, no --, ;, /* or */) are listed in Custom fields.

Click Apply, then Save & Preview. The change applies to this dashboard only: the template itself is unchanged, and installing it again gives the original fields. To change the template for everyone who installs it, duplicate it.