【问题标题】:Inherit qweb report and replace string odoo 9继承 qweb 报告并替换字符串 odoo 9
【发布时间】:2017-03-10 11:56:16
【问题描述】:

我继承了 qweb 报告,现在我想替换字符串 Total without Taxes, Taxes, Total

<div class="row" name="total">
            <div class="col-xs-4 pull-right">
                <table class="table table-condensed">
                    <tr class="border-black">
                        <td><strong>Total Without Taxes</strong></td>
                        <td class="text-right">
                            <span t-field="doc.amount_untaxed"
                                t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/>
                        </td>
                    </tr>
                    <tr>
                        <td>Taxes</td>
                        <td class="text-right">
                            <span t-field="doc.amount_tax"
                                t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/>
                        </td>
                    </tr>
                    <tr class="border-black">
                        <td><strong>Total</strong></td>
                        <td class="text-right">
                            <span t-field="doc.amount_total"
                                t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/>
                        </td>
                    </tr>
                </table>
            </div>
        </div>



<xpath expr="?????" position="replace">

</xpath>

任何简单的解决方案或在线示例?......................................

【问题讨论】:

    标签: openerp odoo-9 qweb


    【解决方案1】:

    请试试这个代码:-

     <xpath expr="//div[@name='total']" position="replace">
           <div class="col-xs-4 pull-right">
                <table class="table table-condensed">
                    <tr class="border-black">
                        <!--Add your Custom String-->
                        <td><strong>Custom String</strong></td>
                        <td class="text-right">
                            <span t-field="doc.amount_untaxed"
                                t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/>
                        </td>
                    </tr>
                    <tr>
                        <!--Add your Custom String for taxes-->
                        <td>Custom String</td>
                        <td class="text-right">
                            <span t-field="doc.amount_tax"
                                t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/>
                        </td>
                    </tr>
                    <tr class="border-black">
                        <!--Add your Custom String for Total-->
                        <td><strong>Custom String</strong></td>
                        <td class="text-right">
                            <span t-field="doc.amount_total"
                                t-field-options='{"widget": "monetary", "display_currency": "doc.pricelist_id.currency_id"}'/>
                        </td>
                    </tr>
                </table>
            </div>
     </xpath>
    

    【讨论】:

      【解决方案2】:

      试试这个。还没有机会测试它。

      <xpath expr="//table[contains(@class, 'table-condensed')]/tr[first()]/td[first()]" position="replace">
          <!-- YOUR XML HERE -->
      </xpath>
      

      【讨论】:

      • Tnx 回答,但在 xpath 中放入任何内容后,我在控制台中收到错误...
      猜你喜欢
      • 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
      相关资源
      最近更新 更多