Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在同一表的报告中添加更多id_Python_Html_Odoo - Fatal编程技术网

Python 在同一表的报告中添加更多id

Python 在同一表的报告中添加更多id,python,html,odoo,Python,Html,Odoo,我正在制作一份报告,可以一次打印一个表中创建的所有帐户。例如:我创建了“现金”、“银行”和“应付款”账户,所以我选择了这三个账户,它们会出现在报告中。我目前正在执行此操作,但它仅在我选择1时显示,它不适用于多个 制作此报告时显示的错误如下: 渲染时出错 ValueError:应为singleton:proyecto_rc.帐户(3,4) 模板:249 路径:/templates/t/t/t/div/div/thead/br/p/table/tbody/td[2]/span 节点:-- 在这里,我

我正在制作一份报告,可以一次打印一个表中创建的所有帐户。例如:我创建了“现金”、“银行”和“应付款”账户,所以我选择了这三个账户,它们会出现在报告中。我目前正在执行此操作,但它仅在我选择1时显示,它不适用于多个

制作此报告时显示的错误如下:

渲染时出错 ValueError:应为singleton:proyecto_rc.帐户(3,4) 模板:249 路径:/templates/t/t/t/div/div/thead/br/p/table/tbody/td[2]/span 节点:--

在这里,我留下了一张我想要的照片




分类账簿
详情: 账户 借记 信用


试试这个例子

   <template id="report_account_view_detail">                 
    <table class="customTable">
        <thead>
            <tr>
                <th>Account</th>
                <th>Debit</th>
                <th>Credit</th>
            </tr>
        </thead>
        <tbody>
            <t t-set="i" t-value="1"/>

                <td>
                    <span t-field="account.title"/>
                </td>
                <td>
                    <span t-field="account.total_account_debit"/>
                </td>
                <td>
                    <span t-field="account.total_account_credit"/>
                </td>
            <t t-set="i" t-value="i+1"/>
        </tbody>
    </table>
</template>

 <template id="report_account_view">
    <t t-call="web.html_container">
        <t t-call="web.external_layout">
            <div class="page">
                <t t-foreach="docs" t-as="account">
                    <t t-call="proyecto_rc.report_account_view_detail">
                        <t t-set="account" t-value="account"/>
                    </t>
                </t>
            </div>
        </t>
    </t>
</template>

账户
借记
信用
   <template id="report_account_view_detail">                 
    <table class="customTable">
        <thead>
            <tr>
                <th>Account</th>
                <th>Debit</th>
                <th>Credit</th>
            </tr>
        </thead>
        <tbody>
            <t t-set="i" t-value="1"/>

                <td>
                    <span t-field="account.title"/>
                </td>
                <td>
                    <span t-field="account.total_account_debit"/>
                </td>
                <td>
                    <span t-field="account.total_account_credit"/>
                </td>
            <t t-set="i" t-value="i+1"/>
        </tbody>
    </table>
</template>

 <template id="report_account_view">
    <t t-call="web.html_container">
        <t t-call="web.external_layout">
            <div class="page">
                <t t-foreach="docs" t-as="account">
                    <t t-call="proyecto_rc.report_account_view_detail">
                        <t t-set="account" t-value="account"/>
                    </t>
                </t>
            </div>
        </t>
    </t>
</template>