Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1764 Vistas

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

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

Thanks a lot you're a life saver 

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
abr 22
2614
1
ago 23
5011
0
ago 21
3258
4
dic 18
13894
1
jul 24
2328