Skip to Content
Menú
This question has been flagged
2 Respostes
1758 Vistes

I am trying to add a new column(Number of Members) to the pdf invoice and hide the tax column when I generate the pdf file no change happen, I want to know which xml file generate the invoce.

here is my xml:



<odoo>
<template id="report_invoice_inherit" inherit_id="account.report_invoice_document">
 
    <xpath expr="//table[@name='invoice_line_table']//thead//tr" position="inside">
        <th name="th_members" class="text-end"><span>Number of Members</span></th>
    </xpath>

  
    <xpath expr="//table[@name='invoice_line_table']//tbody//tr//td[@name='td_quantity']" position="after">
        <td name="td_members" class="text-end">
            <span t-field="line.num_members"/>
        </td>
    </xpath>

  
    <xpath expr="//table[@name='invoice_line_table']//thead//tr//th[@name='th_taxes']" position="attributes">
        <attribute name="class">d-none</attribute>
    </xpath>
    <xpath expr="//table[@name='invoice_line_table']//tbody//tr//td[@name='td_taxes']" position="attributes">
        <attribute name="class">d-none</attribute>
    </xpath>
</template></odoo>
Avatar
Descartar
Best Answer

Hello Aws Dayoub,


I hope you’re doing well!


I've updated the code, so please apply it in your XML file.


If the XML changes still don't reflect after upgrading the module, try these troubleshooting steps:



1). Check for Syntax Errors:

Small syntax errors in XML can prevent the file from loading. Review your XML file carefully for any typos or syntax issues.


2). Confirm View XML Accuracy:

Make sure the view structure in your XML is correct. If it’s accurate but still not working, try using an xpath expression to replace tags and verify your updates are applying properly.


3). Test XML Loading:

Create a test XML file (e.g., axml.xml) to confirm if the system loads your file. This helps ensure Odoo can detect and process your XML changes.


4). Verify XML Inclusion in Manifest:

Confirm that your XML file is referenced in the module’s __manifest__.py. If not included here, Odoo won’t load the file.


5). Check Module Dependencies:

Ensure that all necessary dependent modules are loaded and up to date before updating your module.


6). Inspect Server Logs:

If none of the above steps work, check the server logs for warnings or errors that might reveal why the XML file didn’t update.

// Code In Comment

I Hope this information proves helpful to you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Avatar
Descartar

<odoo>
<template id="report_invoice_inherit" inherit_id="account.report_invoice_document">
<xpath expr="//table[@name='invoice_line_table']//thead//tr" position="inside">
<th name="th_members" class="text-end">
<span>Number of Members</span>
</th>
</xpath>
<xpath expr="//table[@name='invoice_line_table']//tbody//tr//td[@name='td_quantity']" position="after">
<td name="td_members" class="text-end">
<span t-field="line.num_members"/>
</td>
</xpath>
<xpath expr="//table[@name='invoice_line_table']/thead/tr/th[@name='th_taxes']" position="replace"/>
<xpath expr="//table[@name='invoice_line_table']//tbody//tr//td[@name='td_taxes']" position="replace"/>
</template>
</odoo>

Autor Best Answer

Thanks a lot you're a life saver 

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
d’abr. 22
2604
1
d’ag. 23
4979
0
d’ag. 21
3252
4
de des. 18
13893
1
de jul. 24
2319