Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2219 มุมมอง

As the title says, I'm trying to figure out what I need to do to get some other fields to display in the bom overview for each line item like a serial #. Not the pdf report, but the web page you go to before you print the pdf report. I've managed to get these extra fields into the pdf report, just not on the web page. 

I'm attempting to inherit the mrp.report_mrp_bom template to show extra fields on the web page.

I'm also inheriting from mrp.report_mrp_bom_pdf_line to show those fields in the pdf report which is working for me.


อวตาร
ละทิ้ง
ผู้เขียน

I'm not sure why but I can't seem to show my xml

ผู้เขียน

Thank you for your response. I thought I tried inheriting from that before, but maybe i used mrp.BomOverview instead. I will give that a try.

คำตอบที่ดีที่สุด

Hi,

You can inherit the 'mrp.BomOverviewTable' template to add extra fields. For example:

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="custom_module.BomOverviewTable"
t-inherit="mrp.BomOverviewTable" t-inherit-mode="extension">
<xpath expr="//th[@name='th_mrp_bom_h']" position="after">
            <th>UOM</th>
        </xpath>
    </t>
<t t-name="custom_module.BomOverviewSpecialLine"
t-inherit="mrp.BomOverviewLine" t-inherit-mode="extension">
<xpath expr="//td[@name='td_mrp_bom']" position="after">
            <td t-esc="data.uom_name"/>
        </xpath>
    </t>
</templates>

Also, remember to add the XML file to your module's manifest file:
'assets': {
        'web.assets_backend': ['path/to/your/xml/file'],
    }


Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน

Why do you use BomOverviewSpecialLine here instead of BomOverviewLine?

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 24
1514
2
เม.ย. 24
1317
4
พ.ค. 25
2490
2
พ.ค. 25
5849
1
เม.ย. 25
1276