[IMP] rma: add RMA reference to delivery slip report

This commit is contained in:
Lois Rilo
2022-05-13 15:15:36 +02:00
committed by DavidJForgeFlow
parent 55dde2cb27
commit 51fba11626
2 changed files with 58 additions and 0 deletions

View File

@@ -32,6 +32,7 @@
"wizards/rma_make_picking_view.xml",
"wizards/rma_add_stock_move_view.xml",
"wizards/rma_order_line_make_supplier_rma_view.xml",
"report/report_deliveryslip.xml",
],
"installable": True,
"application": True,

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="report_delivery_document" inherit_id="stock.report_delivery_document">
<xpath
expr="//table[@name='stock_move_table']//th[@name='th_sm_quantity']"
position="before"
>
<t
t-set="has_rma"
t-value="bool(o.move_lines.filtered(lambda m: m.rma_line_id))"
/>
<th t-if="has_rma" name="th_sm_rma_line"><strong>RMA</strong></th>
</xpath>
<xpath expr="//table[@name='stock_move_table']/tbody//td[2]" position="before">
<td t-if="has_rma">
<span t-field="move.rma_line_id" />
</td>
</xpath>
<xpath
expr="//table[@name='stock_move_line_table']//th[@name='th_sml_quantity']"
position="before"
>
<t
t-set="sml_has_rma"
t-value="bool(o.move_line_ids.filtered(lambda m: m.move_id.rma_line_id))"
/>
<th t-if="sml_has_rma" name="th_sml_rma_line"><strong>RMA</strong></th>
</xpath>
</template>
<template
id="stock_report_delivery_has_serial_move_line"
inherit_id="stock.stock_report_delivery_has_serial_move_line"
>
<xpath expr="//td[@name='move_line_lot_qty_done']" position="before">
<td t-if="sml_has_rma">
<span t-field="move_line.move_id.rma_line_id" />
</td>
</xpath>
</template>
<template
id="stock_report_delivery_aggregated_move_lines"
inherit_id="stock.stock_report_delivery_aggregated_move_lines"
>
<xpath expr="//td[@name='move_line_aggregated_qty_done']" position="before">
<td t-if="sml_has_rma">
<!-- TODO: To be implemented.
It will require de extension _get_aggregated_product_quantities
-->
</td>
</xpath>
</template>
</odoo>