Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1756 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit

<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 Nejlepší odpověď

Thanks a lot you're a life saver 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
dub 22
2604
1
srp 23
4953
0
srp 21
3252
4
pro 18
13892
1
čvc 24
2318