我正在做一个关于account.account模型的报告,但没有访问account.invoice模型的字段:我的视图xml如下:
<?xml version="1.0"?>
<t t-name="account.reporte_balance">
<t t-call="report.internal_layout" style="font-size:8px;">
<t t-foreach="docs" t-as="o">
<div class="page">
<div class="oe_structure"/>
<div class="row" style="font-size:8px;">
<div class="col-xs-12">.....要访问另一个模型的字段,应编写以下代码。但是没有得到特定的account.account模型。
**<tr t-foreach="HERE WRITE THE ACCOUNT.ACCOUNT MODEL REL" t-as="o">**
<td class="text-center">
<span t-field="o.code"/>
</td>......我很感谢你的帮助。非常感谢您的宝贵时间。
发布于 2016-03-03 22:19:41
如果发票是发票列表,则可以执行以下操作:
<tr t-foreach="invoices" t-as="inv">**
<td class="text-center">
<span t-field="inv.account_id.name"/>
</td>
</tr>也就是说,我不明白你代码中的o.是什么.
https://stackoverflow.com/questions/35774606
复制相似问题