user_odoo
user_odoo

Reputation: 2358

Inherit qweb report and replace string odoo 9

I'm inherit qweb report, now I want replace string 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>

Any simple solution or online example?..................................

Upvotes: 0

Views: 1605

Answers (2)

Hilar AK
Hilar AK

Reputation: 1675

please try this code :-

 <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>

Upvotes: 1

Phillip Stack
Phillip Stack

Reputation: 3378

Try this. Havent had a chance to test it.

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

Upvotes: 1

Related Questions