跳至内容
菜单
此问题已终结
2 回复
1751 查看

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>
形象
丢弃
最佳答案

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
形象
丢弃

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

编写者 最佳答案

Thanks a lot you're a life saver 

形象
丢弃
相关帖文 回复 查看 活动
0
4月 22
2604
1
8月 23
4951
0
8月 21
3248
4
12月 18
13892
1
7月 24
2317