I want to print several id of a table but I get an error and I think it is because I try to show a computed field. I can only print one id at a time and not all. The error that appears is the following:
Error to render compiling AST ValueError: Expected singleton: project_rc.account (3, 4) Template: 252 Path: / templates / t / t / t / t / div / table / tfoot / tr [1] / th [2] / span Node: t-esc = "i.total_account_debit" />
The code is the following:
<t t-call = "web.html_container"> <t t-foreach = "docs" t-as = "i"> <t t-call = "web.external_layout"> <div class = "page"> <t t-foreach = "i.detail_document_ids" t-as = "o"> <tr> <td> <span t-esc = "o.date" /> </td> <td> <span t-esc = "o.razon_social_id.name" /> </td> <td> <span t-esc = "o.total_debit" /> </td> <td> <span t-esc = "o.total_credit" /> </td> </tr> </t> <tfoot> <tr> <th colspan = "2" style = "text-align: center"> Total </th> <th style = "text-align: center"> <span t-esc = "i.total_account_debit" /> </th> <th style = "text-align: center"> <span t-esc = "i.total_account_credit" /> </th> </tr> <tr> <th colspan = "2" style = "text-align: center"> Balance </th> <th colspan = "2" style = "text-align: center"> <span t-esc = "i.balance" /> </th> </tr> </tfoot>
table "account" py
title = fields.Char (string = "Name")
total_account_debit = fields.Float (string = "Total account must", compute = "_ total_account_debit")
total_account_credit = fields.Float (string = "Total account have", compute = "_ total_account_credit")
balance = fields.Float (string = "Balance", compute = "_ balance")