Openerp 打印account.invoice.line模型中的所有行

Openerp 打印account.invoice.line模型中的所有行,openerp,odoo,qweb,Openerp,Odoo,Qweb,我创建了一个用于打印的新模板,并希望对其进行自定义,以便它打印account.invoice.line模型中的所有行。你有办法做到这一点吗。下面是到目前为止模板的代码 <t t-name="account.specifikacioni_report_document"> <t t-call="report.external_layout"> <div class="page"> <table class="table table-

我创建了一个用于打印的新模板,并希望对其进行自定义,以便它打印account.invoice.line模型中的所有行。你有办法做到这一点吗。下面是到目前为止模板的代码

<t t-name="account.specifikacioni_report_document">
  <t t-call="report.external_layout">
    <div class="page">
      <table class="table table-condensed">
        <thead>
          <tr>
            <th>Description</th>
            <th>Quantity</th>
            <th class="text-right">Unit Price</th>
            <th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
            <th class="text-right">Taxes</th>
            <th class="text-right">Amount</th>
          </tr>
        </thead>
        <tbody class="invoice_tbody">
          <tr t-foreach="o.invoice_line" t-as="l">
            <td>
              <span t-field="l.name"/>
            </td>
            <td>
              <span t-field="l.quantity"/>
              <span t-field="l.uos_id" groups="product.group_uom"/>
            </td>
            <td class="text-right">
              <span t-field="l.price_unit"/>
            </td>
            <td class="text-right" groups="sale.group_discount_per_so_line">
              <span t-field="l.discount"/>
            </td>
            <td class="text-right">
              <span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
            </td>
            <td class="text-right">
              <span t-field="l.price_subtotal" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.currency_id&quot;}"/>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </t>
</t>

描述
量
单价
折扣(%)
税
数量

这会打印一张发票的发票行,因为我复制了account.report\u invoice\u文档并刚刚编辑了它,但是我如何在此处列出所有发票行呢?不仅是发票的发票行,您还可以按照
report\u invoice.xml
打印这些行

<table class="table table-condensed">
            <thead>
                <tr>
                    <th>Description</th>
                    <th>Quantity</th>
                    <th class="text-right">Unit Price</th>
                    <th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
                    <th class="text-right">Taxes</th>
                    <th class="text-right">Amount</th>
                </tr>
            </thead>
            <tbody class="invoice_tbody">
                <tr t-foreach="o.invoice_line" t-as="l">
                    <td><span t-field="l.name"/></td>
                    <td>
                        <span t-field="l.quantity"/>
                        <span t-field="l.uos_id"  groups="product.group_uom"/>
                    </td>
                    <td class="text-right">
                        <span t-field="l.price_unit"/>
                    </td>
                    <td class="text-right" groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
                    <td class="text-right">
                        <span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
                    </td>
                    <td class="text-right">
                        <span t-field="l.price_subtotal" 
                            t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                    </td>
                </tr>
            </tbody>
        </table>

描述
量
单价
折扣(%)
税
数量

您可以按照
报告\u invoice.xml
打印行

<table class="table table-condensed">
            <thead>
                <tr>
                    <th>Description</th>
                    <th>Quantity</th>
                    <th class="text-right">Unit Price</th>
                    <th class="text-right" groups="sale.group_discount_per_so_line">Discount (%)</th>
                    <th class="text-right">Taxes</th>
                    <th class="text-right">Amount</th>
                </tr>
            </thead>
            <tbody class="invoice_tbody">
                <tr t-foreach="o.invoice_line" t-as="l">
                    <td><span t-field="l.name"/></td>
                    <td>
                        <span t-field="l.quantity"/>
                        <span t-field="l.uos_id"  groups="product.group_uom"/>
                    </td>
                    <td class="text-right">
                        <span t-field="l.price_unit"/>
                    </td>
                    <td class="text-right" groups="sale.group_discount_per_so_line"><span t-field="l.discount"/></td>
                    <td class="text-right">
                        <span t-esc="', '.join(map(lambda x: x.name, l.invoice_line_tax_id))"/>
                    </td>
                    <td class="text-right">
                        <span t-field="l.price_subtotal" 
                            t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                    </td>
                </tr>
            </tbody>
        </table>

描述
量
单价
折扣(%)
税
数量