Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1956 Lượt xem

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>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ

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

Tác giả Câu trả lời hay nhất

Thanks a lot you're a life saver 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 22
2747
1
thg 8 23
5271
0
thg 8 21
3367
4
thg 12 18
14071
1
thg 7 24
2438