Files
Odoo-Build/snippets/purchase.report_purchaseorder_document.modify_main_table.xml
T

105 lines
5.0 KiB
XML

<data inherit_id="purchase.report_purchaseorder_document" priority="50">
<!-- add default_code -->
<xpath expr="//table/thead/tr/th[1]" position="after">
<th>
<strong>Artikel Nr.</strong>
</th>
</xpath>
<xpath expr="//table/tbody/t/tr/t[1]/td[1]" position="after">
<td>
<span t-field="line.product_id.default_code"/>
</td>
</xpath>
<!-- replace product description -->
<xpath expr="//table/tbody/t[2]/tr/t[1]/td[3]/span" position="replace">
<t>
<span style="font-weight:bold;" t-field="line.product_id.type_description"/>
</t>
</xpath>
<!-- add second row -->
<xpath expr="//tbody//tr[1]" position="after">
<tr>
<td style="padding-bottom :10px; padding-left:3px; line-height: 1.2"/>
<td style="padding:0; padding-left:3px; line-height: 1.2"/>
<td style="padding:0; padding-left:3px; line-height: 1.2" colspan="4">
<span t-field="line.name"/>
<br/>
<t t-if="line.product_id.country_of_origin_id.code">Ursprungsland: <span t-field="line.product_id.country_of_origin_id.code"/>
</t>
<t t-if="line.product_id.hs_code"> / Zollposition: <span t-field="line.product_id.hs_code"/>
</t>
</td>
<td/>
</tr>
<tr style="border-bottom: 1px solid rgb(220,220,220)">
<td colspan="8"/>
</tr>
</xpath>
<!-- format main_table -->
<xpath expr="//table[@class='table table-sm o_main_table table-borderless mt-4']" position="attributes">
<attribute name="style">width: 100%; font-size:9pt</attribute>
<attribute name="class">table table-borderless table-sm</attribute>
</xpath>
<!-- header-->
<xpath expr="//table[@class='table table-borderless table-sm']/thead/tr" position="attributes">
<attribute name="style">border-top:solid 1px; border-bottom: solid 1px; color: black; font-weight:bold;</attribute>
</xpath>
<!-- header: position -->
<xpath expr="//table[@class='table table-borderless table-sm']/thead/tr/th[1]" position="attributes">
<attribute name="style">width: 5mm</attribute>
</xpath>
<!-- header: default code -->
<xpath expr="//table[@class='table table-borderless table-sm']/thead/tr/th[2]" position="attributes">
<attribute name="style">width: 27mm; text-align: right; padding-right: 10px</attribute>
</xpath>
<!-- header: description -->
<xpath expr="//table[@class='table table-borderless table-sm']/thead/tr/th[3]" position="attributes">
<attribute name="style">text-align: left; width: 73mm</attribute>
</xpath>
<!-- header: commitment date -->
<xpath expr="//table[@class='table table-borderless table-sm']/thead/tr/th[5]" position="attributes">
<attribute name="class" separator=" " add="text-start" remove="text-center"/>
</xpath>
<!-- header: qty -->
<xpath expr="//table[@class='table table-borderless table-sm']/thead/tr/th[5]" position="attributes">
<attribute name="style">text-align: right; padding-right: 5px</attribute>
</xpath>
<!-- position -->
<xpath expr="//table[@class='table table-borderless table-sm']/tbody/t[2]/tr/t[1]/td[1]" position="attributes">
<attribute name="style">text-align: right</attribute>
</xpath>
<!-- default code -->
<xpath expr="//table[@class='table table-borderless table-sm']/tbody/t[2]/tr/t[1]/td[2]" position="attributes">
<attribute name="style">text-align: right; padding-right: 10px;</attribute>
</xpath>
<!-- remove taxes -->
<xpath expr="//thead/tr[1]/th[4]" position="replace"/>
<xpath expr="//tbody/t[2]/tr[1]/t[1]/td[4]" position="replace"/>
<!-- commitment date -->
<xpath expr="//table[@class='table table-borderless table-sm']/tbody/t[2]/tr/t[1]/td[4]" position="attributes">
<attribute name="class">text-start</attribute>
<attribute name="t-options-widget">"date"</attribute>
</xpath>
<!-- qty-->
<xpath expr="/t[1]/t[1]/div[1]/table[2]/tbody[1]/t[2]/tr[1]/t[1]/td[5]/span[1]" position="attributes">
<attribute name="t-options-widget">"integer"</attribute>
</xpath>
<xpath expr="/t/t/div/table[2]/tbody/t[2]/tr[1]/t[1]/td[5]/span[1]" position="attributes">
<attribute name="class" separator=" " add="o_bold"/>
</xpath>
<!-- price -->
<xpath expr="//table[@class='table table-borderless table-sm']/tbody/t[2]/tr/t[1]/td[6]/span" position="replace">
<span t-esc="'%g' % line.price_unit if str(line.price_unit)[::-1].find('.') &gt;= 3 else '%.2f' % line.price_unit"/>
</xpath>
<!-- note footer -->
<xpath expr="//table[@class='table table-borderless table-sm']" position="after">
<t t-if="o.note_footer != '&lt;p&gt;&lt;br&gt;&lt;/p&gt;'">
<span class="note" t-field="o.note_footer"/>
</t>
</xpath>
<!-- Summary -->
<xpath expr="//div[@id='total']" position="attributes">
<attribute name="style">font-size:9pt;</attribute>
</xpath>
</data>