【问题标题】:How to pass records to the other page on custom qweb report for account.invoice ( Odoo V11 )?如何将记录传递到 account.invoice ( Odoo V11 ) 的自定义 qweb 报告的其他页面?
【发布时间】:2018-02-01 08:42:16
【问题描述】:

我有一个带有页眉和页脚的自定义报告模板

我从“web.external_layout_standard”扩展了这个页眉和这个页脚

如何在报表页面指定记录数。

例如,我希望产品在 16 日之后切换到其他页面。我有像图片这样的问题。

图片链接: https://i.hizliresim.com/8YZDMk.png

我正在尝试此代码但无法正常工作:

<t t-if="counter==16 and line['price_subtotal']">
      <tr class="text-right" style="border:0;border-top:0">
         <td colspan="6">
           <strong>Ara Toplam:</strong>
             <span>
               <t t-esc="subtotal" t-options="{'widget':'monetary', 
                                 'display_currency':o.currency_id}"/>
             </span>
         </td>
      </tr>
      <t t-set="counter" t-value="0" />
      <div style="page-break-after:auto;"></div>
</t> 

【问题讨论】:

    标签: xml odoo qweb odoo-11 odoo-view


    【解决方案1】:
    <t t-set="count" t-value="0"/>
    <t t-set="page" t-value="16"/>
    <t t-foreach="your_loop_variable" t-as="c">
        <t t-if="counter==16 and line['price_subtotal']">
          <tr class="text-right" style="border:0;border-top:0">
             <td colspan="6">
               <strong>Ara Toplam:</strong>
                 <span>
                   <t t-esc="subtotal" t-options="{'widget':'monetary', 
                                     'display_currency':o.currency_id}"/>
                 </span>
             </td>
          </tr>
          <t t-set="counter" t-value="0" />
          <t t-set="count" t-value="count+1" />
          <t t-if="count==page">
            <p style="page-break-after:auto;"></p>
            <t t-set="page" t-value="page+16" />
          </t>
        </t> 
    </t>
    
    • 请试试这个代码:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多