Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] mrp_bom_report: Improve excess line error #505

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mrp_bom_line_layer_and_designator/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/mrp-addons",
"depends": [
"mrp",
"mrp_bom_report",
],
"data": [
"reports/report_mrp_bom_report_customized_document.xml",
"reports/report_mrp_report_bom_structure.xml",
"views/mrp_bom_line_view.xml",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="report_mrp_bom_customized_document_inherit"
inherit_id="mrp_bom_report.report_mrp_bom_customized_document"
>
<xpath expr="//table/thead/tr" position="inside">
<th class="text-start">Layer</th>
<th class="text-start">Designator</th>
</xpath>
<xpath expr="//table/tbody//tr" position="inside">
<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>
</xpath>
</template>
</odoo>
1 change: 0 additions & 1 deletion mrp_bom_line_product_brand_info/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"license": "AGPL-3",
"website": "https://github.com/avanzosc/mrp-addons",
"depends": [
"mrp",
"mrp_bom_report",
"product_brand_supplierinfo",
],
Expand Down
36 changes: 28 additions & 8 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,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
<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>
61 changes: 17 additions & 44 deletions mrp_bom_report/report/mrp_bom_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@
<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>
<tr
<t
t-foreach="doc._get_children(doc.bom_line_ids)"
t-as="line"
>
Expand All @@ -31,48 +26,26 @@
t-set="code"
t-value="line['product_name'].split('[')[1].split(']')[0] if '[' in line['product_name'] and ']' in line['product_name'] else ''"
/>
<t
<t
t-if="bom_line_id.product_id.default_code == code"
>

<td class="text-start">
<span
id="product_name"
t-raw="line['product_name'] or ''"
/>
</td>
<td name="td-qty" class="text-end">
<span t-esc="line['product_qty'] or 0.0" />
</td>
<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">
<tr>
<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>
id="product_name"
t-raw="line['product_name'] or ''"
/>
</td>
<td name="td-qty" class="text-end">
<span t-esc="line['product_qty'] or 0.0" />
</td>
<td name="td-operation" class="text-start">
<span t-esc="line['operation'] or ''" />
</td>
</tr>
</t>
</t>
</tr>
</t>
</tbody>
</table>
</div>
Expand Down
Loading