Skip to content

Commit

Permalink
[IMP] mrp_bom_report: Simplify report and add fields in origin module…
Browse files Browse the repository at this point in the history
…'s report
  • Loading branch information
unaiberis committed Feb 5, 2025
1 parent 4207b20 commit 76183fd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 39 deletions.
33 changes: 22 additions & 11 deletions mrp_bom_line_product_brand_info/report/mrp_bom_report.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="report_mrp_bom_customized_document"
inherit_id="mrp_bom_report.report_mrp_bom_customized_document"
>
<template id="report_mrp_bom_customized_document" inherit_id="mrp_bom_report.report_mrp_bom_customized_document">
<span id="product_name" position="after">
<span
t-if="line and 'manufacturer_codes' in line and line['manufacturer_codes']"
>
<br />
<span t-esc="line['manufacturer_codes']" />
</span>
<span t-if="line and 'manufacturer_codes' in line and line['manufacturer_codes']">
<br />
<span t-esc="line['manufacturer_codes']" />
</span>
</span>
</template>
<xpath expr="//table/thead/tr" position="inside">
<th class="text-start">Product Code</th>
<th class="text-start">Manufacturer Codes</th>
<th class="text-start">Brand</th>
</xpath>
<xpath expr="//table/tbody//tr" position="inside">
<td class="text-start">
<span t-esc="bom_line_id['product_code'] or ''" />
</td>
<td class="text-start">
<span t-esc="bom_line_id['manufacturer_codes'] or ''" />
</td>
<td class="text-start">
<span t-esc="bom_line_id['markings'].name if bom_line_id['markings'] else ''" />
</td>
</xpath>
</template>
</odoo>
28 changes: 0 additions & 28 deletions mrp_bom_report/report/mrp_bom_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
<th class="text-start">Reference/Description</th>
<th name="th-qty" class="text-end">Qty.</th>
<th name="th-operation" class="text-start">Fase</th>
<th class="text-start">Product Code</th>
<th class="text-start">Manufacturer Codes</th>
<th class="text-start">Brand</th>
<th class="text-start">Layer</th>
<th class="text-start">Designator</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -47,29 +42,6 @@
<td name="td-operation" class="text-start">
<span t-esc="line['operation'] or ''" />
</td>
<td class="text-start">
<span
t-esc="bom_line_id['product_code'] or ''"
/>
</td>
<td class="text-start">
<span
t-esc="bom_line_id['manufacturer_codes'] or ''"
/>
</td>
<td class="text-start">
<span
t-esc="bom_line_id['markings'].name if bom_line_id['markings'] else ''"
/>
</td>
<td class="text-start">
<span t-esc="bom_line_id['layer'] or ''" />
</td>
<td class="text-start">
<span
t-esc="bom_line_id['designator'] or ''"
/>
</td>
</t>
</t>
</tr>
Expand Down

0 comments on commit 76183fd

Please sign in to comment.