Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
9598 Переглядів

Hello everyone,

I'm trying to customize the invoice report in Odoo 11.

Problem is, xpath tag "replace" isn't working properly - or, at least, as it used to do in previous versions. Odoo 11 documentation says, and I quote:

[replace:] the content of the inheritance spec replaces the matched node. Any text node containing only $0 within the contents of the spec will be replaced by a complete copy of the matched node, effectively wrapping the matched node.

Now, what I need is to totally replace the invoice lines in invoice PDF report, so I'm trying with a complete replace of the table tag:

<template id="invoice_gross_amount_document" inherit_id="account.report_invoice_document">

  <xpath expr="//div/table[@name='invoice_line_table']" position="replace">

  <p>TEST</p>

  </xpath>

</template>


This is supposed to erase the table and replace it with the simple string "Test".

But here's what I get: http://oi66.tinypic.com/4sgznt.jpg
The string "TEST" is simply shown before the invoice line table, instead of replacing it.

Why is it happening, and how can I succeed in replacing the node completely? Could someone please help me out?

Аватар
Відмінити
Найкраща відповідь
<template id="invoice_gross_amount_document" inherit_id="account.report_invoice_document">      
<xpath expr="//table[@name='invoice_line_table']" position="replace">
    <table class="table table-condensed" name="invoice_line_table" >
    <thead style="background-color:#FFFDF1">
    <tr>
            <th>S.No</th>
        </tr>
        </thead>
    <tbody class="invoice_tbody">
        <td ><span t-esc="s_no"/></td>
    </tbody>
</template>
      
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
лют. 24
7214
5
груд. 19
11001
Display photos on qweb Вирішено
3
квіт. 19
7219
1
вер. 18
8035
Odoo11 Custom Report Вирішено
1
вер. 18
7767